Introduce the backend pieces for brain memory ingestion, routing, and system telemetry so the new knowledge workflows can project data into a brain view. The supporting tests lock in the new behavior and keep the expanded backend surface stable. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
49 lines
938 B
Python
49 lines
938 B
Python
from pydantic import BaseModel
|
|
from datetime import datetime
|
|
|
|
|
|
class MessageCreate(BaseModel):
|
|
content: str
|
|
|
|
|
|
class MessageOut(BaseModel):
|
|
id: str
|
|
role: str
|
|
content: str
|
|
model: str | None
|
|
tokens_used: int | None
|
|
attachments: list[dict] | None = None
|
|
created_at: datetime
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class ConversationCreate(BaseModel):
|
|
title: str | None = None
|
|
|
|
|
|
class ConversationOut(BaseModel):
|
|
id: str
|
|
title: str | None
|
|
message_count: int
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class ChatRequest(BaseModel):
|
|
message: str
|
|
conversation_id: str | None = None
|
|
agent_id: str | None = None
|
|
model_name: str | None = None
|
|
file_ids: list[str] = []
|
|
|
|
|
|
class ChatResponse(BaseModel):
|
|
conversation_id: str
|
|
message_id: str
|
|
content: str
|
|
agent_name: str
|
|
model_name: str | None = None
|