Misc improvements

This commit is contained in:
2026-02-20 06:59:31 +00:00
parent 734cade8d9
commit dba4122653
33 changed files with 1844 additions and 420 deletions

View File

@@ -17,7 +17,22 @@ class Message(BaseModel):
class RAGRequest(BaseModel):
"""Request model for RAG endpoint."""
messages: list[Message] = Field(..., description="Conversation history")
messages: list[Message] = Field(
...,
description="Current conversation messages (user and assistant only)",
)
notifications: list[str] | None = Field(
default=None,
description="Active notifications for the user",
)
conversation_history: str | None = Field(
default=None,
description="Formatted conversation history",
)
user_nickname: str | None = Field(
default=None,
description="User's nickname or display name",
)
class RAGResponse(BaseModel):
@@ -34,12 +49,21 @@ class RAGServiceBase(ABC):
"""
@abstractmethod
async def query(self, messages: list[dict[str, str]]) -> str:
"""Send conversation history to RAG endpoint and get response.
async def query(
self,
messages: list[dict[str, str]],
notifications: list[str] | None = None,
conversation_history: str | None = None,
user_nickname: str | None = None,
) -> str:
"""Send conversation to RAG endpoint and get response.
Args:
messages: OpenAI-style conversation history
messages: Current conversation messages (user/assistant only)
e.g., [{"role": "user", "content": "Hello"}, ...]
notifications: Active notifications for the user (optional)
conversation_history: Formatted conversation history (optional)
user_nickname: User's nickname or display name (optional)
Returns:
Response string from RAG endpoint