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
regex in langchain/agents/mrkl/base.py #2898
Comments
@captainst Could you please provide the example where its |
hi @azamiftikhar1000 The test code I used is the following snippet:
besides, you can also type the following prompt generated by Langchain to chat.openai.com to see the reply:
|
@captainst Thank you for that, It seems that when we use Where as gpt-4 is giving I will shortly create the PR with the solution. Thanks! |
### #2898 Instead of `"Action" and "Action Input"` keywords, we are getting `"Action 1" and "Action 1 Input" or "Action Input 1" ` from **gpt-3.5-turbo** Updated the Regular expression to handle all these cases Attaching the screenshot of the result from the updated Regular expression. <img width="1036" alt="Screenshot 2023-04-16 at 1 39 00 AM" src="https://user-images.githubusercontent.com/55012400/232251184-23ca6cc2-7229-411a-b6e1-53b2f5ec18a5.png">
### langchain-ai/langchain#2898 Instead of `"Action" and "Action Input"` keywords, we are getting `"Action 1" and "Action 1 Input" or "Action Input 1" ` from **gpt-3.5-turbo** Updated the Regular expression to handle all these cases Attaching the screenshot of the result from the updated Regular expression. <img width="1036" alt="Screenshot 2023-04-16 at 1 39 00 AM" src="https://user-images.githubusercontent.com/55012400/232251184-23ca6cc2-7229-411a-b6e1-53b2f5ec18a5.png">
### langchain-ai#2898 Instead of `"Action" and "Action Input"` keywords, we are getting `"Action 1" and "Action 1 Input" or "Action Input 1" ` from **gpt-3.5-turbo** Updated the Regular expression to handle all these cases Attaching the screenshot of the result from the updated Regular expression. <img width="1036" alt="Screenshot 2023-04-16 at 1 39 00 AM" src="https://user-images.githubusercontent.com/55012400/232251184-23ca6cc2-7229-411a-b6e1-53b2f5ec18a5.png">
Hi, @captainst! I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale. From what I understand, the issue is about a regex pattern in the file Before we close this issue, we wanted to check if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days. Thank you for your contribution, and we appreciate your understanding as we work to keep our issue tracker up to date. Let us know if you have any further questions or concerns! Best regards, |
When use agent to answer question "Who is Leo DiCaprio's current girlfriend? What is her current age raised to the 0.43 power?"
I saw openAI gives the following initial reply:
Instead of "Action" and "Action Input" keywords, we have "Action 1" and "Action 1 Input" instead.
The regex in langchain/agents/mrkl/base.py:
regex = r"Action: (.?)[\n]Action Input:[\s](.)"
is better to be changed to
regex = r"Action.?: (.?)[\n]Action.? Input:[\s](.)"
In order to avoid tool not found error.
The text was updated successfully, but these errors were encountered: