chef_agent

This commit is contained in:
2026-09-09 09:15:12 +08:00
parent bc44de93bc
commit 3405d1b355
6 changed files with 256 additions and 4 deletions

View File

@@ -8,6 +8,7 @@ from langchain.agents.middleware import SummarizationMiddleware
from langchain.agents.middleware.summarization import ContextMessages
from langchain.chat_models import init_chat_model
from langchain_core.language_models import BaseChatModel
from langchain_deepseek import ChatDeepSeek
from langchain_tavily import TavilySearch
from langgraph.checkpoint.postgres import PostgresSaver
from psycopg import Connection
@@ -81,14 +82,20 @@ class ChefAgent:
logger.info("chef_agent初始化llm...")
llm = init_chat_model(
# llm = init_chat_model(
# model="deepseek-v4-flash",
# model_provider="deepseek",
# api_key=settings.DEEPSEEK_API_KEY,
# extra_body={"thingking":{"type": "disabled"}}
# )
llm = ChatDeepSeek(
model="deepseek-v4-flash",
model_provider="deepseek",
api_key=settings.DEEPSEEK_API_KEY
api_key=settings.DEEPSEEK_API_KEY,
extra_body={"thingking": {"type": "disabled"}}
)
logger.info("chef_agent的llm初始化完成")
return cast(BaseChatModel, llm)
return llm
@staticmethod
def _create_tools() -> list[Any]: