- 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
22 lines
454 B
Python
22 lines
454 B
Python
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,用于匹配条件
|