fix: 兼容openai适配器的非标返回#6450
Hidden character warning
Conversation
There was a problem hiding this comment.
Sorry @a61995987, your pull request is larger than the review limit of 150000 diff characters
|
不好意思 刚刚提交错分支了 现已修改 |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors the internal architecture for managing computer-use tools, making the system more modular and robust. It also addresses a critical compatibility issue with non-standard OpenAI adapter responses, ensuring smoother operation with various LLM providers. Furthermore, the dashboard receives several quality-of-life improvements, enhancing user experience for configuration, persona management, and API key handling. Highlights
Changelog
Ignored Files
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a compatibility fix for non-standard API responses from OpenAI adapters, specifically addressing cases where the tool_call.type field might be missing or empty. The changes correctly identify and补全 (complete) this field to 'function' when a function call is present, preventing AssertionErrors in the OpenAI SDK. The implementation is clear, well-commented, and enhances the robustness of the system when integrating with various OpenAI-compatible platforms. No critical or high-severity issues were found.
|
#6829 fixed. |
fix:兼容openai适配器的非标返回
PR(#5610)的分散提交
Modifications / 改动点
fix:兼容openai适配器的非标返回:
修改文件:astrbot\core\provider\sources\openai_source.py
在_query_stream方法中的async for chunk in stream循环中增加了兼容非标准返回处理的处理 补全可能缺失的补全tool_call.type字段
Screenshots or Test Results / 运行截图或测试结果
Checklist / 检查清单
😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
/ 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。
👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
/ 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。
🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in
requirements.txtandpyproject.toml./ 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到
requirements.txt和pyproject.toml文件相应位置。😮 My changes do not introduce malicious code.
/ 我的更改没有引入恶意代码。