A small enterprise chatbot library
Project description
Unilink Python Client
Overview
This document provides instructions for the Python client used to connect to the Unilink web service. The Unilink service receives text requests, processes them through artificial intelligence programs, and returns text responses.
Connection and Setup
To use the client, you must provide an access token and the base web address. Every request requires this access token, which is placed in the request headers automatically by the client.
The client verifies the connection upon creation. It returns a 403 error if the token is incorrect. It returns a connection error if the web address is incorrect.
Client Functions
The client provides the following functions to interact with the service:
send_message(user_id, message): Sends a user text request to the service and returns a generated answer. This function has a 120-second timeout.get_history(user_id): Returns a list of saved text records for a specific user.clear_history(user_id): Deletes all saved text records for a specific user.get_user(user_id): Retrieves stored information for a specific user. It returns nothing if the user is not found.create_user(user_id): Adds a new user to the database.update_user(user_id, new_user_id, content): Modifies existing information for a user. This includes changing their identification number or updating their data content.delete_user(user_id): Removes a user from the database.
Data Structures
The client receives data organized into the following structures:
- UserData: Contains the user details, including name, phone, email, address, city, problem_summary, and preferences.
- User: Contains the system identification number, unit identification number, external identification string, the user data content, and a timestamp.
- MessageResponse: Contains the text response from the artificial intelligence and the user information.
- Message: Contains the message identification number, user identification number, the text content, and a timestamp. The content is automatically converted from text format into a dictionary.
I can generate executable code examples demonstrating how to initialize the client and call these specific functions.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unilink_lib-1.2.0.tar.gz.
File metadata
- Download URL: unilink_lib-1.2.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77e455a250c550b527607bca7cad884f569ee79aa93f763300a552080216a35a
|
|
| MD5 |
3cc69ff10a3dc2dcb0be2200018354a4
|
|
| BLAKE2b-256 |
ca35eba82af9bda27cc0a32a4bd4c1bc975bab27ee45054602f94d61056a235a
|
File details
Details for the file unilink_lib-1.2.0-py3-none-any.whl.
File metadata
- Download URL: unilink_lib-1.2.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2bbec908373f8c3aa5e5a5ff4b0c902e941c364c3244b60946a4c2b83639454
|
|
| MD5 |
ee4a7418879009d4d38796f9630f2943
|
|
| BLAKE2b-256 |
ce63f6e8e899b649d5c9794783ef03e7f95d29b0bd2c692b2fe6be9b6eb22e3b
|