- Introduced a new chat endpoint for handling user messages and generating responses. - Added models for chat message requests and responses. - Implemented a conversation store to manage chat history. - Integrated memory layer for retrieving presentation context. - Created tools for accessing presentation outlines and searching slides. - Updated dependencies to include jsonschema for validation. - Enhanced the API router to include the new chat functionality.
20 lines
504 B
Python
20 lines
504 B
Python
import uuid
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class ChatMessageRequest(BaseModel):
|
|
presentation_id: uuid.UUID
|
|
message: str = Field(min_length=1, max_length=8000)
|
|
conversation_id: Optional[uuid.UUID] = None
|
|
|
|
model_config = ConfigDict(extra="forbid")
|
|
|
|
|
|
class ChatMessageResponse(BaseModel):
|
|
conversation_id: uuid.UUID
|
|
response: str
|
|
tool_calls: list[str] = Field(default_factory=list)
|
|
|
|
model_config = ConfigDict(extra="forbid")
|