-
Notifications
You must be signed in to change notification settings - Fork 27.7k
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
Add support to declare imports for code agent #31355
Add support to declare imports for code agent #31355
Conversation
@JasonZhu1313 you can check failing style tests here |
Done thanks! |
Seems all good to me, thanks a lot @JasonZhu1313! @LysandreJik do you want to have a double check? |
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.
Ok, sounds good
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
What does this PR do?
Collected suggestions and guidance from @aymeric-roucher!
Add support for declaring a list of available packages to import for the code agent. Previously, the code agent was limited to a fixed list of packages, which restricted its ability to utilize a wide range of Python's utilities and functionalities. By providing this import list explicitly, we aim to enable the model to leverage the provided packages.
List of changes:
*tools*
in DEFAULT_REACT_CODE_SYSTEM_PROMPT with <<tool_names>> which will later be replaced with a list of tool names to confine model on a list of possible tools it can invoke._, code_action = self.extract_action(llm_output=llm_output, split_token="Code:")
andrationale, raw_code_action = self.extract_action(llm_output=llm_output, split_token="Code:")
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.