Skip to main content

ChatATP Studio SDK

Python SDK for building and interacting with agents created in ChatATP Studio.

  • Async-first API
  • Conversation lifecycle management
  • Streaming support
  • Fully typed

PyPI Python

chatatp-studio

Official Python SDK for the ChatATP Studio Developer API.

Requirements

  • Python 3.10+

Installation

pip install chatatp-studio

Quick start

import asyncio
from chatatp_studio import ChatATPClient

async def main():
    client = ChatATPClient(api_key="chatatp_sk_...")

    # Send a message — conversation lifecycle handled automatically
    result = await client.chat(
        agent_id=7,
        external_user_id="user_12345",
        message="Do you ship to Lagos?",
    )

    print(result.agent_message.content)
    # → "Yes, shipping is available."

    await client.aclose()

asyncio.run(main())

Context manager

async with ChatATPClient(api_key="chatatp_sk_...") as client:
    result = await client.chat(
        agent_id=7,
        external_user_id="user_12345",
        message="Hello!",
    )

Streaming

import sys

async for event in await client.chat_stream(
    agent_id=7,
    external_user_id="user_12345",
    message="Give me a summary of your return policy.",
):
    if event.type == "agent.response.delta":
        sys.stdout.write(event.data.get("delta", ""))
        sys.stdout.flush()
    elif event.type == "tool.execution.started":
        print(f"\n[Running tool: {event.data.get('name')}]")
    elif event.type == "tool.execution.completed":
        print(f"\n[Tool completed. Result: {event.data.get('result')}]")
    elif event.type == "error":
        print(f"\n[Error: {event.data.get('message')}]")
    elif event.type == "agent.response.completed":
        print("\nFinished!")

Resources

# Agents
page  = await client.agents.list()
agent = await client.agents.retrieve(7)

# Conversations
conv = await client.conversations.create(7, "user_12345")
page = await client.conversations.list(agent_id=7)
await client.conversations.delete(conv.id)

# Messages
history = await client.messages.list(conv.id)
reply   = await client.messages.send(conv.id, "Hello")

# Usage
usage = await client.usage.retrieve()

Error handling

from chatatp_studio import NotFoundError, RateLimitError

try:
    await client.agents.retrieve(999)
except NotFoundError:
    print("Not found")
except RateLimitError:
    print("Rate limited")

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chatatp_studio-0.1.1.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

chatatp_studio-0.1.1-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file chatatp_studio-0.1.1.tar.gz.

File metadata

  • Download URL: chatatp_studio-0.1.1.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for chatatp_studio-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2d1b9dc9d2263b12dfeca68fc974491b55c0961f0fae02c01a8113ffabbef25c
MD5 9d0355b171eda260d2922d032049fa77
BLAKE2b-256 fca2aa71b91d20a36e44685943aecfb6facea34eb84d6c6c43898011f5f05d52

See more details on using hashes here.

File details

Details for the file chatatp_studio-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: chatatp_studio-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for chatatp_studio-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 515e224c915f49997bcacdc98f84d12a631f5380a92f1bf0548963ddb26d5140
MD5 0bb74945e813b1d4ac26d07153f33cc4
BLAKE2b-256 c44ab289f67a73f8c4fd8091f8916263245f1ee6391e4398dd22d7642202f2d8

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