feat: 引入deepseek结构化输出
This commit is contained in:
@@ -69,7 +69,11 @@ class NarrativeAgent:
|
||||
user_profile=user_profile,
|
||||
birth_year=birth_year,
|
||||
)
|
||||
response = llm.invoke(prompt)
|
||||
json_llm = llm.bind(
|
||||
model_kwargs={"response_format": {"type": "json_object"}},
|
||||
max_tokens=4096,
|
||||
)
|
||||
response = json_llm.invoke(prompt)
|
||||
return (response.content or "").strip()
|
||||
except Exception as e:
|
||||
logger.warning("NarrativeAgent 生成叙事失败: %s", e)
|
||||
|
||||
Reference in New Issue
Block a user