-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
extra_tools
argument in create_pandas_dataframe_agent()
doesn't seem to be working
#11737
Comments
🤖 Hello, Thank you for bringing this to our attention. From your description, it seems like you're expecting the The prompt is generated based on the agent type and does not dynamically include the names of the extra tools. In your case, the agent type is If you want to include the def _get_prompt_and_tools(self, extra_tools):
prompt = "You are working with a pandas dataframe in Python. The name of the dataframe is `df`.\nYou should use the tools below to answer the question posed of you:\n\n"
for tool in extra_tools:
prompt += f"{tool.name}: {tool.description}\n"
# ... rest of the function
return prompt, tools This will include the names and descriptions of the I hope this helps! If you have any other questions, feel free to ask. Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Hmm, I don't really see the point of extending the basic tools but not telling the model about them in the prompt. How is the model supposed to use the new tools if it is not provided information on it? If you are open to it, I can try and make a pull request that integrates these custom tools into the prompt. |
… is not working) (#13203) - **Description:** Fix #11737 issue (extra_tools option of create_pandas_dataframe_agent is not working), - **Issue:** #11737 , - **Dependencies:** no, - **Tag maintainer:** @baskaryan, @eyurtsev, @hwchase17 I needed this method at work, so I modified it myself and used it. There is a similar issue(#11737) and PR(#13018) of @PyroGenesis, so I combined my code at the original PR. You may be busy, but it would be great help for me if you checked. Thank you. - **Twitter handle:** @lunara_x If you need an .ipynb example about this, please tag me. I will share what I am working on after removing any work-related content. --------- Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
…aframe_agent is not working) (langchain-ai#13203) - **Description:** Fix langchain-ai#11737 issue (extra_tools option of create_pandas_dataframe_agent is not working), - **Issue:** langchain-ai#11737 , - **Dependencies:** no, - **Tag maintainer:** @baskaryan, @eyurtsev, @hwchase17 I needed this method at work, so I modified it myself and used it. There is a similar issue(langchain-ai#11737) and PR(langchain-ai#13018) of @PyroGenesis, so I combined my code at the original PR. You may be busy, but it would be great help for me if you checked. Thank you. - **Twitter handle:** @lunara_x If you need an .ipynb example about this, please tag me. I will share what I am working on after removing any work-related content. --------- Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
Hello, i think i managed to add tools to the pandas agent. Please check https://stackoverflow.com/a/77941942/12906920 Maybe it will help. |
System Info
Platform: Windows Server 2022
Python: 3.11.6
Langchain version: 0.0.306
Who can help?
@agola11 @hwchase17
Information
Related Components
Reproduction
Creating a test tool
Setting up the pandas_dataframe_agent
Executing agent with debugging enabled
The prompt from the above log
Expected behavior
Where did my custom tool
test_tool
disappear? I expected it to show up after python_repl_ast?The text was updated successfully, but these errors were encountered: