feat: 引入deepseek结构化输出
This commit is contained in:
@@ -798,7 +798,11 @@ def generate_chapter_content(self, user_id: str, stage: str, new_content: str):
|
||||
new_content=new_content,
|
||||
existing_content=existing_content,
|
||||
)
|
||||
response = llm.invoke(prompt)
|
||||
json_llm = llm.bind(
|
||||
model_kwargs={"response_format": {"type": "json_object"}},
|
||||
max_tokens=4096,
|
||||
)
|
||||
response = json_llm.invoke(prompt)
|
||||
new_narrative = response.content.strip()
|
||||
if _is_json_narrative(new_narrative):
|
||||
narrative = new_narrative
|
||||
|
||||
Reference in New Issue
Block a user