feat: 添加 AI Agent 对话测试工具 + 代码优化
主要变更: - 新增 tests/test_ai_chat.py: AI Agent 对话测试工具 - 优化 core/pydantic_ai_agent.py 和 db/chat_log_db.py - 清理归档文件,更新文档 Made-with: Cursor
This commit is contained in:
@@ -16,15 +16,12 @@ from pathlib import Path
|
||||
import logging
|
||||
|
||||
|
||||
from utils.service_base import BaseService
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class ServiceBase:
|
||||
"""最小化基类,替代缺失的 utils.service_base"""
|
||||
pass
|
||||
|
||||
|
||||
class GeminiExtractV2Service(ServiceBase):
|
||||
class GeminiExtractV2Service(BaseService):
|
||||
"""Gemini印花提取V2服务类 - 使用服务,更经济"""
|
||||
|
||||
SERVICE_NAME = "gemini_extract_v2"
|
||||
@@ -69,7 +66,7 @@ class GeminiExtractV2Service(ServiceBase):
|
||||
DEFAULT_PROMPT = "提取印花图案,把褶皱移除。补齐缺失的部分,要生成完整,细节丰富,严格按照原图的元素位置生成平面的印花图,不要相似的,相似度要100%,生成高质量的印刷图"
|
||||
# DEFAULT_PROMPT = "生成图片,把衣服的图案展开起来做成数码印花印刷平面图。去掉皱褶,生成图案增强细节。排除衣服图案以外内容"
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
super().__init__(name="gemini_extract_v2")
|
||||
self.session = None
|
||||
|
||||
def image_to_base64(self, image_path: str) -> str:
|
||||
|
||||
Reference in New Issue
Block a user