Skip to content

feature: Chat Model Interfaces and Response Types Implementation#3

Merged
xerial merged 4 commits intomainfrom
feature/20250501_213131
May 2, 2025
Merged

feature: Chat Model Interfaces and Response Types Implementation#3
xerial merged 4 commits intomainfrom
feature/20250501_213131

Conversation

@xerial
Copy link
Copy Markdown
Member

@xerial xerial commented May 2, 2025

Chat Model Interfaces and Response Types Implementation

This PR introduces foundational interfaces for chat-based AI models along with new response types for error handling:

  1. ChatModel: Basic interface for synchronous chat communication with properly defined return type
  2. StreamingChatModel: Interface for streaming chat responses
  3. StreamingChatResponseHandler: Callback interface for handling streaming responses with three event methods:
    • onPartialResponse: Receives incremental text updates
    • onComplete: Called when a full response is ready
    • onError: Provides error handling
  4. ChatResponse: Response type for chat interactions with status code and content
  5. Integration with StatusCode for proper error handling and reporting

These interfaces establish the core abstraction layer for implementing various chat model providers while offering both synchronous and streaming interaction patterns with standardized error handling capabilities.

@github-actions github-actions Bot added the feature New feature label May 2, 2025
@xerial xerial marked this pull request as ready for review May 2, 2025 17:13
@xerial xerial changed the title feature: Add LLMAgent and model parameters feature: Chat Model Interfaces and Response Types Implementation May 2, 2025
@xerial xerial merged commit e61e3ec into main May 2, 2025
7 checks passed
@xerial xerial deleted the feature/20250501_213131 branch May 2, 2025 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant