Pre-release
This release is a pre-release and may not be stable for production use.
ivyanalytics
Python bindings for ingesting conversational data into ivyanalytics
Requirements
Python 3.7+
Installation
pip install ivyanalytics
Tests
Execute pytest to run the tests.
Getting Started
Please follow the installation procedure and then run the following:
import ivyanalytics
from ivyanalytics.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.ivyanalytics.io
# See configuration.py for a list of all supported configuration parameters.
configuration = ivyanalytics.Configuration(
host = "https://api.ivyanalytics.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: HTTPBasic
configuration = ivyanalytics.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with ivyanalytics.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = ivyanalytics.ConversationApi(api_client)
conversation_data_schema = ivyanalytics.ConversationDataSchema(conversation_data_schema = ivyanalytics.ConversationDataSchema(conversations=
[
{
"conversation_id": "my_historical_conv_id_1",
"tenant_id": "<my_unique_tenant_id>",
"conversation_created_at": "2020-02-20T20:19:34Z",
"messages": [
{
"id": "message_id",
"role": "user",
"body": "What time does the team arrive?",
"created_at": "2020-02-20T20:19:34Z",
},
{
"id": "message_id",
"role": "assistant",
"body": "The team arrives at 6pm.",
"created_at": "2020-02-20T20:20:23Z",
},
],
"metadata": {
"model": "gpt-3.5-turbo-16k",
"user_id": "2947451",
"metadata_1": "value",
"metadata_2": "value",
},
},
{
"conversation_id": "my_historical_conv_id_2",
"tenant_id": "<my_unique_tenant_id>",
"conversation_created_at": "2020-02-20T20:19:34Z",
"messages": [
{
"id": "message_id",
"role": "user",
"body": "What time does the team arrive?",
"created_at": "2020-02-20T20:19:34Z",
},
{
"id": "message_id",
"role": "assistant",
"body": "The team arrives at 6pm.",
"created_at": "2020-02-20T20:20:23Z",
},
],
"metadata": {
"model": "gpt-3.5-turbo-16k",
"user_id": "2947451",
"metadata_1": "value",
"metadata_2": "value",
},
},
]) )
try:
# Log a batch of conversations to BigQuery
api_response = api_instance.ingest_conversations(conversation_data_schema)
print("The response of ConversationApi->ingest_conversations:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling ConversationApi->ingest_conversations: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to https://api.ivyanalytics.io
| Class | Method | HTTP request | Description |
|---|---|---|---|
| ConversationApi | ingest_conversations | POST /v1/conversations | Log a batch of conversations to BigQuery |
Metadata
Release files for ivyanalytics 0.0b0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ivyanalytics-0.0b0.tar.gz | 31.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ivyanalytics-0.0b0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 89.8 kB
Release files / ivyanalytics-0.0b0.tar.gz
| Download URL | ivyanalytics-0.0b0.tar.gz |
|---|---|
| Size | 31.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0e58ac18f5fb294cc227c9bfef3f28f8f337724d8099d183b064335f8c2fc11a
|
|
BLAKE2b-256 checksum How to use checksums |
29bdb5f6f08d306924658105465723ecf9bf557bb181f1baadc95bf46d628351
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.7
|
Release files / ivyanalytics-0.0b0-py3-none-any.whl
| Download URL | ivyanalytics-0.0b0-py3-none-any.whl |
|---|---|
| Size | 58.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9f3bc09dbfefcb84a06f2f550dca061ea347413eebf5d1c81f5c3d764cf60cd5
|
|
BLAKE2b-256 checksum How to use checksums |
486e31666984fc712bc783b755f8540505662e40886952ca9a65adff5159d6ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.7
|