-
Notifications
You must be signed in to change notification settings - Fork 257
[Bug Fix] Camel example with wrong and missing agent arguments #766
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?
Conversation
Summary of ChangesHello @HwVanICI, 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 addresses several bugs within the Camel example's training code, specifically focusing on how agent configuration parameters are managed. The changes ensure that critical arguments like token limits and step timeouts are correctly passed to the underlying agent and model components, aligning them with the expected API and system-wide rollout configurations. This improves the robustness and consistency of the Camel example's agent behavior. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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 addresses issues with incorrect and missing arguments in the Camel example. The changes correctly pass step_timeout to the ChatAgent and add the request_timeout configuration. However, there is an issue with how the token limit is specified. The max_tokens parameter is used, but max_total_tokens should be used instead to correctly limit the total length of the generated trajectory. I have provided a specific comment with a suggested fix.
| self.async_reward_fn = AsyncRewardWrapper(gsm8k_reward_fn) | ||
|
|
||
| async def run_agent(self, data, client: ArealOpenAI): | ||
| model_config_dict = {"max_tokens": self.max_total_tokens} |
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 parameter max_tokens is being used here, but based on the variable name self.max_total_tokens and the implementation in areal/experimental/openai/client.py, it seems max_total_tokens should be used instead.
Using max_tokens sets the maximum number of new tokens to be generated, ignoring the length of the prompt. Using max_total_tokens will correctly limit the total length of the prompt and the completion to self.max_total_tokens by calculating max_new_tokens as max_total_tokens - prompt_length.
This could lead to generating sequences longer than intended, potentially causing issues.
| model_config_dict = {"max_tokens": self.max_total_tokens} | |
| model_config_dict = {"max_total_tokens": self.max_total_tokens} |
Description
This PR fixes bugs of the Camel example training code. In the run_agent() function of CamelMathAgent class is updated to pass the max_tokens and step_timeout parameter properly as follows.
Related Issue
Fixes #(issue)
Type of Change
work as expected)
Checklist
jb build docs/gemini review)Need help? Check the Contributing Guide or ask in
GitHub Discussions!