claroai


Nameclaroai JSON
Version 0.0b1 PyPI version JSON
download
home_pagehttps://getclaro.ai
SummaryClaro AI Python client
upload_time2024-04-30 05:48:54
maintainerNone
docs_urlNone
authorClaro AI
requires_pythonNone
licenseNone
keywords claro ai claro api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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

```sh
pip install claroai
```


Then import the package:
```python
import claroai
```

## Getting Started



```python
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)

            

Raw data

            {
    "_id": null,
    "home_page": "https://getclaro.ai",
    "name": "claroai",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "Claro AI, Claro API",
    "author": "Claro AI",
    "author_email": "hello@getclaro.ai",
    "download_url": "https://files.pythonhosted.org/packages/8e/ab/9ced7b0443dc9d0a73a2cf65466e46ee05d6054684583692277ac21e84ca/claroai-0.0b1.tar.gz",
    "platform": null,
    "description": "# Claro AI python client\nAPI for data ingestion\n\nproject:\n\n- API version: 1.0.0\n- Package version: 0.0.b0\n\n## Requirements.\n\nPython 3.7+\n\n## Installation & Usage\n### pip install\n\n```sh\npip install claroai\n```\n\n\nThen import the package:\n```python\nimport claroai\n```\n\n## Getting Started\n\n\n\n```python\nimport claroai\n\nfrom pprint import pprint\n\nfrom claroai.rest import ApiException\n\n\nconfiguration = claroai.Configuration(username=\"test\", password=\"test\")\n\n\nwith claroai.ApiClient(configuration) as api_client:\n    # Create an instance of the API class\n    conversation_api_instance = claroai.ConversationApi(api_client)\n\n    conversation_data_schema = claroai.ConversationData(\n        [  # List[claroai.ConversationSchema] or claroai.ConversationSchema\n            claroai.ConversationSchema(\n                conversation_id=\"1\",\n                conversation_created_at=\"2021-01-01T00:00:00Z\",\n                user_id=\"1\",\n                messages=[\n                    {\n                        \"id\": \"Thiyagu\",\n                        \"role\": \"user\",\n                        \"body\": \"What time does the team arrive?\",\n                        \"created_at\": \"2020-02-20T20:19:34Z\",\n                    }\n                ],\n            ),\n            claroai.ConversationSchema(\n                conversation_id=\"2\",\n                conversation_created_at=\"2021-01-01T00:00:00Z\",\n                user_id=\"1\",\n                messages=[\n                    {\n                        \"id\": \"Thiyagu 2\",\n                        \"role\": \"user\",\n                        \"body\": \"What time does the team arrive?\",\n                        \"created_at\": \"2020-02-20T20:19:34Z\",\n                    }\n                ],\n            ),\n        ]\n    )\n\n    interaction_api_instance = claroai.InteractionApi(api_client)\n\n    interaction_data_schema = claroai.InteractionData(\n        claroai.InteractionSchema(  # claroai.InteractionSchema or List[claroai.InteractionSchema]\n            conversation_id=\"1\",\n            interaction_id=\"1\",\n            user_id=\"1\",\n            content=\"What time does the team arrive?\",\n            created_at=\"2020-02-20T20:19:34Z\",\n            interacted_at=\"2020-02-20T20:19:34Z\",\n        )\n    )\n    try:\n        # Log a batch of conversations to BigQuery\n        conversation_api_response = conversation_api_instance.ingest_conversation(\n            conversation_data_schema\n        )\n\n        print(\"The response of ConversationApi->ingest_conversations:\\n\")\n        pprint(conversation_api_response)\n\n        # Log a batch of interactions to BigQuery\n        interaction_api_response = interaction_api_instance.ingest_interaction(\n            interaction_data_schema\n        )\n        print(\"The response of ConversationApi->ingest_interactions:\\n\")\n        pprint(interaction_api_response)\n\n    except ApiException as e:\n        print(\"Exception when ingesting data: %s\\n\" % e)\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Claro AI Python client",
    "version": "0.0b1",
    "project_urls": {
        "Homepage": "https://getclaro.ai"
    },
    "split_keywords": [
        "claro ai",
        " claro api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d90a70c9270dca690ef7ef92e613ecf8d25bf3317f5a220433e027857651d9d0",
                "md5": "1de3d50ea082419737c653eae223d5ad",
                "sha256": "8a7710a21b2350876ed3c7526d2ec92abe80d13058375b782a552433804bfd2c"
            },
            "downloads": -1,
            "filename": "claroai-0.0b1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1de3d50ea082419737c653eae223d5ad",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 53397,
            "upload_time": "2024-04-30T05:48:50",
            "upload_time_iso_8601": "2024-04-30T05:48:50.483718Z",
            "url": "https://files.pythonhosted.org/packages/d9/0a/70c9270dca690ef7ef92e613ecf8d25bf3317f5a220433e027857651d9d0/claroai-0.0b1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8eab9ced7b0443dc9d0a73a2cf65466e46ee05d6054684583692277ac21e84ca",
                "md5": "48056e31866f8252da92de07c565988e",
                "sha256": "679a70af232e0496f33abb2582cf65d2e74fea6b58f1cb7ed89475c2c1753a57"
            },
            "downloads": -1,
            "filename": "claroai-0.0b1.tar.gz",
            "has_sig": false,
            "md5_digest": "48056e31866f8252da92de07c565988e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 31060,
            "upload_time": "2024-04-30T05:48:54",
            "upload_time_iso_8601": "2024-04-30T05:48:54.093465Z",
            "url": "https://files.pythonhosted.org/packages/8e/ab/9ced7b0443dc9d0a73a2cf65466e46ee05d6054684583692277ac21e84ca/claroai-0.0b1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-30 05:48:54",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "claroai"
}
        
Elapsed time: 0.38649s