Pre-release
This release is a pre-release and may not be stable for production use.
Claro AI python client
API for data ingestion
project:
- API version: 1.0.0
- Package version: 0.0.b0
Requirements.
Python 3.7+
Installation & Usage
pip install
pip install claroai
Then import the package:
import claroai
Getting Started
import claroai
from pprint import pprint
from claroai.rest import ApiException
configuration = claroai.Configuration(username="test", password="test")
with claroai.ApiClient(configuration) as api_client:
# Create an instance of the API class
conversation_api_instance = claroai.ConversationApi(api_client)
conversation_data_schema = claroai.ConversationData(
[ # List[claroai.ConversationSchema] or claroai.ConversationSchema
claroai.ConversationSchema(
conversation_id="1",
conversation_created_at="2021-01-01T00:00:00Z",
user_id="1",
messages=[
{
"id": "Thiyagu",
"role": "user",
"body": "What time does the team arrive?",
"created_at": "2020-02-20T20:19:34Z",
}
],
),
claroai.ConversationSchema(
conversation_id="2",
conversation_created_at="2021-01-01T00:00:00Z",
user_id="1",
messages=[
{
"id": "Thiyagu 2",
"role": "user",
"body": "What time does the team arrive?",
"created_at": "2020-02-20T20:19:34Z",
}
],
),
]
)
interaction_api_instance = claroai.InteractionApi(api_client)
interaction_data_schema = claroai.InteractionData(
claroai.InteractionSchema( # claroai.InteractionSchema or List[claroai.InteractionSchema]
conversation_id="1",
interaction_id="1",
user_id="1",
content="What time does the team arrive?",
created_at="2020-02-20T20:19:34Z",
interacted_at="2020-02-20T20:19:34Z",
)
)
try:
# Log a batch of conversations to BigQuery
conversation_api_response = conversation_api_instance.ingest_conversation(
conversation_data_schema
)
print("The response of ConversationApi->ingest_conversations:\n")
pprint(conversation_api_response)
# Log a batch of interactions to BigQuery
interaction_api_response = interaction_api_instance.ingest_interaction(
interaction_data_schema
)
print("The response of ConversationApi->ingest_interactions:\n")
pprint(interaction_api_response)
except ApiException as e:
print("Exception when ingesting data: %s\n" % e)
Metadata
Release files for claroai 0.0b1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| claroai-0.0b1.tar.gz | 31.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| claroai-0.0b1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 84.5 kB
Release files / claroai-0.0b1.tar.gz
| Download URL | claroai-0.0b1.tar.gz |
|---|---|
| Size | 31.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
679a70af232e0496f33abb2582cf65d2e74fea6b58f1cb7ed89475c2c1753a57
|
|
BLAKE2b-256 checksum How to use checksums |
8eab9ced7b0443dc9d0a73a2cf65466e46ee05d6054684583692277ac21e84ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / claroai-0.0b1-py3-none-any.whl
| Download URL | claroai-0.0b1-py3-none-any.whl |
|---|---|
| Size | 53.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8a7710a21b2350876ed3c7526d2ec92abe80d13058375b782a552433804bfd2c
|
|
BLAKE2b-256 checksum How to use checksums |
d90a70c9270dca690ef7ef92e613ecf8d25bf3317f5a220433e027857651d9d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|