fix(prompt-optimizer): 修复数据模型和业务逻辑问题

- 修复PromptOptimizerSessionHistory模型中session_id外键关系错误
- 统一会话ID的使用逻辑,区分内部ID和外部session_id
- 修复服务层create_update_model_config方法参数不匹配问题
- 优化会话历史查询逻辑,确保正确的数据关联
- 修复消息创建时的会话验证和ID映射问题
- 改进Repository层的类型注解准确性
This commit is contained in:
mengyonghao
2025-12-17 17:20:05 +08:00
parent 07273e4c03
commit 3950b718cd
4 changed files with 25 additions and 11 deletions

View File

@@ -73,7 +73,6 @@ class PromptOptimizerService:
self,
tenant_id: uuid.UUID,
config_id: uuid.UUID,
model_id: uuid.UUID,
system_prompt: str,
) -> PromptOptimizerModelConfig:
"""
@@ -86,7 +85,6 @@ class PromptOptimizerService:
Args:
tenant_id (uuid.UUID): The unique identifier of the tenant.
config_id (uuid.UUID): The unique identifier of the configuration to create or update.
model_id (uuid.UUID): The unique identifier of the model associated with this configuration.
system_prompt (str): The system prompt content used for prompt optimization.
Returns: