Files
MemoryBear/api/app/schemas/memory_agent_schema.py
Ke Sun 0fff23d2a2 feat(memory): make config_id optional and improve configuration validation
- Make config_id optional in UserInput and Write_UserInput schemas
- Update write_memory and read_memory method signatures to accept Optional[str] for config_id
- Implement automatic config retrieval from end_user connection when config_id is not provided
- Add explicit error handling for missing memory configurations with descriptive error messages
- Improve emotion_controller to validate config_id using MemoryConfigService when provided
- Fallback to get_end_user_connected_config when config_id is None
- Distinguish between specific "no configuration found" errors and other exceptions for better debugging
- Ensures users can operate without explicitly providing config_id if they have a connected configuration
2025-12-24 16:06:54 +08:00

22 lines
454 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from typing import Optional
from pydantic import BaseModel
class UserInput(BaseModel):
message: str
history: list[dict]
search_switch: str
group_id: str
config_id: Optional[str] = None
class Write_UserInput(BaseModel):
message: str
group_id: str
config_id: Optional[str] = None
class End_User_Information(BaseModel):
end_user_name: str # 这是要更新的用户名
id: str # 宿主ID用于匹配条件