-
Notifications
You must be signed in to change notification settings - Fork 398
fix bugs in memory #753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix bugs in memory #753
Conversation
Summary of ChangesHello @vinci-grape, 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 primarily focuses on improving the robustness and functionality of the agent's memory management and file system interaction. It addresses specific configuration handling within the memory module to ensure correct LLM integration and significantly enhances the 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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces some good fixes and enhancements. The changes in the memory module correctly associate summary_model
and max_tokens
with the memory's own configuration, and move the max_tokens
setting to the correct LLM configuration block, which is a good bug fix. The update to FileSystemTool
to allow reading multiple files is a useful feature. I've left one comment regarding the return format of the read_file
function to ensure the output is more robustly parsable by the LLM.
results[path] = f.read() | ||
except Exception as e: | ||
results[path] = f'Read file <{path}> failed, error: ' + str(e) | ||
return str(results) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function returns a string representation of a Python dictionary (str(results)
), which is not valid JSON and can be hard for the LLM to parse reliably. It's better to return a standard JSON string. This also makes the implementation align better with the docstring which states it returns a dictionary (by returning its JSON representation).
Note: You will need to add import json
at the top of the file to use json.dumps
.
return str(results) | |
return json.dumps(results) |
Change Summary
Related issue number
Checklist
pre-commit install
andpre-commit run --all-files
before git commit, and passed lint check.