Skip to content

Repository files navigation

AI Sandbox SDK for Python

Motion headline

GAAPIsStreamingPython

UX-First Value Cards

Quick IntegrationReal-Time ExperienceReliability by Default
Minimal setup and low-change onboardingStreaming chunks via send_chat_stream(...)Built-in timeout and retry controls

Visual Integration Flow

flowchart LR
A[Create Agent] --> B[Create Chat Channel]
B --> C[Send Message]
C --> D[SSE Stream Chunks]
D --> E[Attach Knowledge Base]
E --> F[Customer-Ready Experience]
Loading

60-Second Quick Start

importosfromai_sandbox_sdkimportAiSandboxClientclient=AiSandboxClient(
base_url=os.getenv("AI_SANDBOX_BASE_URL", "https://www.egroupai.com"),
api_key=os.getenv("AI_SANDBOX_API_KEY", ""),
)
agent=client.create_agent({
"agentDisplayName": "Support Agent",
"agentDescription": "Handles customer inquiries",
})
agent_id=int(agent["payload"]["agentId"])
channel=client.create_chat_channel(agent_id, {
"title": "Web Chat",
"visitorId": "visitor-001",
})
channel_id=channel["payload"]["channelId"]
forchunkinclient.send_chat_stream(agent_id, {
"channelId": channel_id,
"message": "What is the return policy?",
"stream": True,
}):
print(chunk)

Installation

pip install ai-sandbox-sdk-python

Integration Sanity Checklist

  • Keep AI_SANDBOX_API_KEY in secure runtime configuration.
  • Confirm AI_SANDBOX_BASE_URL points to the intended environment.
  • Verify [DONE] handling in stream consumers before release.

Snapshot

MetricValue
API Coverage11 operations (Agent / Chat / Knowledge Base)
Stream Modetext/event-stream with [DONE] handling
Retry Safety429/5xx auto-retry for GET/HEAD + capped exponential backoff
Error SurfaceApiError with status/body/trace_id
ValidationProduction-host integration verified
Release ReadinessRun draft-release-train and guards checks before merge

Links

License

This SDK is released under the Apache-2.0 license.

About

Official Python SDK for AI Sandbox v1 integration

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages