Skip to main content

A Python SDK for Sinopsis AI

Project description

Sinopsis AI Cover Image

Official Sinopsis AI SDK for Python

PyPI version License: MIT

This is the official Python SDK for interacting with Sinopsis AI, designed to simplify the process of logging user prompts and responses, and managing conversation data.

Features

  • Easy Integration: Quickly integrate Sinopsis AI into your Python applications.
  • Session Management: Start, manage, and end sessions with ease.
  • Conversation Logging: Log user prompts and assistant responses with timestamps.
  • API Interaction: Communicate with the Sinopsis AI backend API seamlessly.
  • Error Handling: Robust error handling with retry logic for network requests.

Installation

You can install the package using pip:

pip install sinopsis-ai

Quick Start

Here’s how to get started with the Sinopsis AI SDK:

Import and Initialize the SDK

from sinopsis_ai import SinopsisAI

# Initialize the SDK with your API key
api_key = "your_api_key_here"
client = SinopsisAI(api_key)

Start a Session

# Start a session with a specific user ID
session = client.start_session(user="user_id")

# Alternatively, let the SDK generate a user ID, session ID, and conversation ID automatically
session = client.start_session()

Log a User Prompt

# Log a user's input prompt
client.log_prompt("Hello, how are you?")

Log an Assistant Response

# Log the assistant's response along with model details
client.log_response(
    assistant_response="I'm fine, thank you!",
    chatbot_name="ChatbotName",
    model_name="ModelName",
    model_input={"input": "Hello, how are you?"}
)

End the Session

# End the session, ensuring all data is saved
client.end_session()

Getting Help/Support

If you need help setting up or configuring the Python SDK (or anything else) please send us an email at hello@sinopsisai.com and we're ready to help you!

Resources

License

Licensed under the MIT license, see LICENSE

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

sinopsis-ai-0.4.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sinopsis_ai-0.4.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file sinopsis-ai-0.4.0.tar.gz.

File metadata

  • Download URL: sinopsis-ai-0.4.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.13

File hashes

Hashes for sinopsis-ai-0.4.0.tar.gz
Algorithm Hash digest
SHA256 6efff852e1681366cd9500b9bfb640a293b9b55703dfdee08706b607b52e14c0
MD5 9e6a1aceae019679bb1c36d9bd8d83ce
BLAKE2b-256 d662d1bd2ecf8ddb1ebe5e47615d180fc8ffae22261d2d5b5383d1217d6aea90

See more details on using hashes here.

File details

Details for the file sinopsis_ai-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: sinopsis_ai-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.13

File hashes

Hashes for sinopsis_ai-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6463c5745dbe67ff1211ea2545845bc28f59da1e36450ac9f7fe05da8e10a328
MD5 6720019acc569c67c21be6546d59c9df
BLAKE2b-256 632cb96c75848e9e949532a6152a844b3baba1e488a106b60e199397b0aee54e

See more details on using hashes here.

Supported by

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