An SDK for Feedback Intelligence data insertion
Project description
Feedback Intelligence SDK
The feedbackintelligenceSDK is a Python package designed to interact with the Feedback Intelligence API. It allows you
to add context, chat, and feedback data to the database, both synchronously and asynchronously.
Installation
You can install the package via pip:
pip install feedbackintelligence
Usage Initialization To use the SDK, first initialize it with your API key:
from feedbackintelligence.fi import FeedbackIntelligenceSDK
sdk = FeedbackIntelligenceSDK(api_key="your_api_key_here")
Methods
- add_context
Add context to the database (synchronous)
response = sdk.add_context( project_id=1, context="Sample context", context_id=123)
# Or you can skip the context_id
#response = sdk.add_context( project_id=1, context="Sample context")
- add_context_async
Add context to the database (asynchronous)
response = await sdk.add_context_async( project_id=1, context="Sample context", context_id=123)
- add_chat
Add chat data to the database (synchronous).
from feedbackIntelligence.schemas import Message, Context, Feedback
# Make sure to use the exact date format that is used in the example
messages = [
Message(role='human', text='Hello', prompt='test',
date='2020-01-20T13:00:00',
context=Context(text='new_context')),
Message(role='ai', text='Hi there',
date='2020-01-20T13:01:00',
feedback=Feedback(thumbs_up=1, message='Feedback message(optional)'))]
response = sdk.add_chat( project_id=1, chat_id="chat-1", messages=messages)
- add_chat_async
Add chat data to the database (asynchronous).
response = await sdk.add_chat_async( project_id=1, chat_id="chat-1", messages=messages)
- add_feedback
Add feedback data to the database (synchronous).
response = sdk.add_feedback( project_id=1, message="Great service", source="email")
- add_feedback_async
Add feedback data to the database (asynchronous).
response = await sdk.add_feedback_async( project_id=1, message="Great service", source="survey")
visit this links to see examples
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 feedbackintelligence-1.0.3.tar.gz.
File metadata
- Download URL: feedbackintelligence-1.0.3.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df40926485539124583b3f008c96eee097f68c5c0378888c903329eb2f9e9e71
|
|
| MD5 |
3f1a13908ec203f9c196976c572fc0d7
|
|
| BLAKE2b-256 |
7330a1abbee70aa35f23833d31ae0b37c53c6016cdd7b2234fb21c4a307da14d
|
File details
Details for the file feedbackintelligence-1.0.3-py3-none-any.whl.
File metadata
- Download URL: feedbackintelligence-1.0.3-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1145026c0c805cbf707f5ff04a0317f38d407dca155cb8094e7906dccf53e676
|
|
| MD5 |
aae639ddb0e40233b2a768a85d71caca
|
|
| BLAKE2b-256 |
bae3a96597733c77deebbf9de86e929666c22e7a022cd337b11b91ab1e592580
|