Skip to main content

Python SDK for impaction.ai

Project description

impaction.ai Python SDK

This is the official server-side Python SDK for impaction.ai. This library allows you to easily send your data to impaction.ai.

Visit the full documentation to see the detailed usage.

Installation

Install the Python SDK with pip:

pip install impaction-ai

Getting Started

Below is a typical usage of the SDK:

from impaction_ai import ImpactionAI
from impaction_ai.constants import ROLE_USER

# Initialize SDK Client
imp = ImpactionAI(
    project_id="PROJECT_ID",
    api_key="API_KEY"
)

# Record a user
imp.identify_user(
    user_id="USER_ID",
    email="USER_EMAIL",
    country_code="US"
)

# Open a session
imp.open_session(
    session_id="SESSION_ID",
    user_id="USER_ID",
    assistant_id="ASSISTANT_ID"
)

# Record a message
imp.create_message(
    session_id="SESSION_ID",
    message_index=1,
    role=ROLE_USER,
    content="Hey, you there?"
)

# Close a session
imp.close_session(
    session_id="SESSION_ID"
)

Refer to the documentation to see more detailed usage.

Contribution

If you have any issues with the SDK, feel free to open Github issues and we'll get to it as soon as possible.

We welcome your contributions and suggestions!

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

impaction_ai-0.1.1.tar.gz (10.8 kB view hashes)

Uploaded Source

Built Distribution

impaction_ai-0.1.1-py3-none-any.whl (14.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page