-
Notifications
You must be signed in to change notification settings - Fork 15.8k
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
Error Code 400. Can ask follow up questions with agent_executor #15050
Comments
🤖 Hey @shamussim-ai! I'm Dosu, a friendly bot here to assist you with your LangChain problems while the human maintainers are busy. I can help you solve bugs, answer your questions, and guide you on becoming a better contributor to our project. Remember, no question is too small or too big for me. Let's get that issue sorted out together! Based on the error message you provided, it seems like the issue might be related to the format of the input you're passing to the In LangChain, the Given this, it's possible that the error is occurring because the If you're still encountering issues, it would be helpful if you could provide more specific details about how you're formatting your input for the For more information, you can refer to the LangChain source code:
I hope this helps! If you have any other questions, feel free to ask. Best, 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. |
@shamussim-ai This seems like a weird error. Could you try using Here, result = agent_executor.invoke({"input": "What is the recommended dose of doxycycline for acne for a male aged 12 years old?"}) |
Hi @cyai. Appreciate the response. That helped but the error still persists. I can ask a follow-up question. However, on the 2nd or 3rd follow-up question. I am returned with the same error message. For your reference, please see the trace below.
Additionally, I get throw a warning when the agen_executor.invoke runs successfully. Any advice on how to deal with it. Where should I add the output_parser?
|
Hi @cyai. Wondering if you have any other solution for this. Error still persists. |
System Info
Python 3.10.10
langchain 0.0.350
langchain-community 0.0.3
langchain-core 0.1.1
google-search-results 2.4.2
Windows
Who can help?
No response
Information
Related Components
Reproduction
Summary
Firstly, I ask the LangChain agent using code below and get a good response.
result = agent_executor({"What is the recommended dose of doxycycline for acne for a male aged 12 years old?"})
However, I ask a new followup question by changing the query and get and error.
result = agent_executor({"What other forms of acne treatment are there for male teenagers around the age of 12 years old ?"})
BadRequestError: Error code: 400 - {'error': {'message': "'$.messages[1].content' is invalid.
Code Used
Output
Shows good results
Next I run agen_executor with another question and this is where I get a bug.
result = agent_executor({"new question"})
Even if I just repeat the question ie use the initial one. I get this error.
Error
`---------------------------------------------------------------------------
BadRequestError Traceback (most recent call last)
Cell In[15], line 1
----> 1 result = agent_executor({"What is the recommended dose of doxycycline for acne for a male aged 12 years old?"})
File /anaconda/envs/langchain/lib/python3.10/site-packages/langchain/chains/base.py:312, in Chain.call(self, inputs, return_only_outputs, callbacks, tags, metadata, run_name, include_run_info)
310 except BaseException as e:
311 run_manager.on_chain_error(e)
--> 312 raise e
313 run_manager.on_chain_end(outputs)
314 final_outputs: Dict[str, Any] = self.prep_outputs(
315 inputs, outputs, return_only_outputs
316 )
File /anaconda/envs/langchain/lib/python3.10/site-packages/langchain/chains/base.py:306, in Chain.call(self, inputs, return_only_outputs, callbacks, tags, metadata, run_name, include_run_info)
299 run_manager = callback_manager.on_chain_start(
300 dumpd(self),
301 inputs,
302 name=run_name,
303 )
304 try:
305 outputs = (
--> 306 self._call(inputs, run_manager=run_manager)
307 if new_arg_supported
308 else self._call(inputs)
...
(...)
937 stream_cls=stream_cls,
938 )
BadRequestError: Error code: 400 - {'error': {'message': "'$.messages[1].content' is invalid. Please check the API reference: https://platform.openai.com/docs/api-reference.", 'type': 'invalid_request_error', 'param': None, 'code': None}}`
Expected behavior
Formatted normal output
The text was updated successfully, but these errors were encountered: