Skip to content

fix: 修复报告生成时的报错,处理模型返回 None 的情况#395

Open
111azhao wants to merge 1 commit into666ghj:mainfrom
111azhao:main
Open

fix: 修复报告生成时的报错,处理模型返回 None 的情况#395
111azhao wants to merge 1 commit into666ghj:mainfrom
111azhao:main

Conversation

@111azhao
Copy link
Copy Markdown

  • chat() 方法:当模型返回的 content 为 None 时,直接返回 None,避免 re.sub() 接收 None 崩溃
  • chat_json() 方法:去掉 response_format 参数,改为从模型文本输出中手动提取 JSON,兼容 markdown 代码块和裸 JSON 两种格式

- chat() 方法:当模型返回的 content 为 None 时,直接返回 None,避免 re.sub() 接收 None 崩溃
- chat_json() 方法:去掉 response_format 参数,改为从模型文本输出中手动提取 JSON,兼容 markdown 代码块和裸 JSON 两种格式
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. LLM API Any questions regarding the LLM API labels Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LLM API Any questions regarding the LLM API size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant