Turnspan API Reference
What you'll find here:
- Core server API:
chatkit.server–ChatKitServerand related helpers for receiving messages, streaming responses, and wiring up tools and widgets. - Actions:
chatkit.actions–ActionandActionConfigfor widget callbacks. - FastAPI adapter:
chatkit.fastapi– HTTP request handling and disconnect cleanup for the optionalfastapiextra. - Protocol:
chatkit.protocol– JSON request parsing and encoding for transport adapters. - Turns:
chatkit.turns– typed triggers, request context, and response outcomes. - Store integration:
chatkit.store– separate interfaces for threads and items, attachment metadata, and attachment file operations. - Store checks:
chatkit.store_checks– contract checks for app-owned thread stores. - Agents:
chatkit.agentsstreams provider output.chatkit.agent_inputconverts saved history into model input. - Data models:
chatkit.modelsdefines threads, items, and attachments. - Requests and events:
chatkit.requestsdescribes browser operations.chatkit.eventsdefines streamed updates. - Errors:
chatkit.errors– structured error types your ChatKit integration can raise so ChatKit can emit consistentErrorEvents to the client. - Widgets:
chatkit.widgetsprovides typed builders.chatkit.widget_modelsowns the JSON tree,chatkit.widget_streamstreams updates, andchatkit.templatesloads.widgetfiles with thetemplatesextra. - Icons.
chatkit.iconsdefines the icon names accepted by widgets and progress events.