🔧 You are viewing: API Specification - Complete technical referenceSee also: User Guide · Quick Reference
- Component: ChatSDK - Unified text chat with conversation history
- Module:
gaia.chat.sdk - Import:
from gaia.chat.sdk import ChatSDK, ChatConfig, ChatResponse, SimpleChat, quick_chat - Source:
src/gaia/chat/sdk.py
Overview
ChatSDK provides a unified interface for text-based chat interactions with automatic conversation history management. It supports local LLMs (via Lemonade Server), Claude API, and ChatGPT/OpenAI API, with model-specific prompt formatting through the Prompts class. Key Features:- Automatic conversation history tracking
- Multi-model support (14+ models via Prompts)
- Streaming and non-streaming responses
- RAG (Retrieval-Augmented Generation) integration
- Session management
- Performance statistics
- Simple and advanced interfaces
- Interactive chat commands
- Agent communication
- Code generation
- Document Q&A (with RAG)
API Specification
ChatConfig
ChatResponse
ChatSDK
SimpleChat
Convenience Functions
Usage Examples
Example 1: Basic Chat
Example 2: Streaming Chat
Example 3: Chat with RAG
Testing Requirements
Dependencies
Acceptance Criteria
- ChatSDK class implemented
- All methods with docstrings
- Conversation history management works
- Multi-model support via Prompts
- Streaming works correctly
- RAG integration functional
- SimpleChat convenience class works
- Session management works
- All unit tests pass (10+ tests)
- Exported from
gaia/__init__.py - Example applications work
ChatSDK Technical Specification