chore: print more information in concat mode and handle empty tool calls for easy debugging#713
chore: print more information in concat mode and handle empty tool calls for easy debugging#713garrett4wade merged 4 commits intomainfrom
Conversation
Summary of ChangesHello @nuzant, 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 enhances the debugging experience and robustness of OpenAI interaction handling. It refactors warning mechanisms to provide more frequent and detailed feedback on message similarity issues and prompt concatenation, while also standardizing the representation of empty tool calls to prevent serialization problems. These changes aim to make it easier to identify and resolve issues related to conversation tree building and API interactions. Highlights
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
|
d626691 to
4eb84ad
Compare
There was a problem hiding this comment.
Code Review
This pull request improves logging and debugging capabilities by removing one-time warning flags and providing more detailed information in warnings. The changes in cache.py to report differences in similar messages and in client.py to handle empty tool_calls are good enhancements. I've identified a few areas for improvement: an incorrect type hint, an opportunity for a more detailed warning message, and a typo in a comment. Overall, these are solid improvements.
…lls for easy debugging (#713)
…lls for easy debugging (inclusionAI#713)

Description
This pull request refactors warning logic and improves message similarity reporting in the OpenAI interaction cache and client modules. The main changes include removing global single-warning flags, enhancing the reporting of message differences, and improving handling of empty tool calls.
Warning logic and reporting improvements:
MESSAGE_SIMILARITY_WARNEDandCONCAT_PROMPT_TOKEN_IDS_WARNED) in bothcache.pyandclient.py, so warnings are now logged every time the condition is met instead of only once. [1] [2]_is_similar_on_last_messagefunction incache.pyto return detailed differences between parent and child messages, improving the warning message with specific key differences. [1] [2]concat_prompt_token_ids_with_parentinclient.pyto log a warning every time extra fields are present in messages, rather than only once.Message and output handling improvements:
createmethod ofclient.py, changed handling oftool_callsso that empty lists are converted toNone, ensuring proper serialization and downstream handling.Related Issue
Fixes #(issue)
Type of Change
work as expected)
Checklist
jb build docs/gemini review)Breaking Change Details (if applicable):
Additional Context
Need help? Check the Contributing Guide or ask in
GitHub Discussions!