Skip to content
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

Whoops! There was an error while talking to OpenAI. Error: "Unable to extract error" #23

Open
pooriaarab opened this issue Jul 1, 2023 · 3 comments

Comments

@pooriaarab
Copy link

Hi,

I've deployed to railway and changed gpt 4 to gpt-3.5-turbo.

i can send one message to the telegram bot and it'll respond. but the second message i get this error on Telegram:

"Whoops! There was an error while talking to OpenAI. Error: "Unable to extract error"

On Raleway, these are the error logs:

at ChatConversationalAgent.extractToolAndInput (/app/node_modules/langchain/dist/agents/chat_convo/index.cjs:125:19)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ChatConversationalAgent._plan (/app/node_modules/langchain/src/agents/agent.ts:262:13)
at async AgentExecutor._call (/app/node_modules/langchain/src/agents/executor.ts:77:8)
at async AgentExecutor.call (/app/node_modules/langchain/src/chains/base.ts:96:18)
{ message: '"Unable to extract error"' }

What might have caused this?

@leo-usa
Copy link

leo-usa commented Jul 20, 2023

I had the same problem. I increased the re-try number from 5 to 10, it's slightly better, but not gone completely.

@leo-usa
Copy link

leo-usa commented Jul 20, 2023

I looked at the railway log, and found the the bot actually got the message back from OpenAI, but it couldn't parse the message:

response: {
ok: false,
status: 400,
Input: Do you know railway?
Entering new agent_executor chain...
Error: Unable to parse JSON response from chat agent.
Yes, I am familiar with railways. Railways are systems of transportation that use tracks to guide trains, trams, or other vehicles. They are commonly used for passenger transportation as well as for the movement of goods and freight. Railways have been an essential mode of transportation globally for many years. If you have any specific questions about railways or need information on a particular aspect, feel free to ask!
at ChatConversationalAgent.extractToolAndInput (/app/node_modules/langchain/dist/agents/chat_convo/index.cjs:125:19)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ChatConversationalAgent._plan (/app/node_modules/langchain/src/agents/agent.ts:262:13)
at async AgentExecutor._call (/app/node_modules/langchain/src/agents/executor.ts:77:8)
at async AgentExecutor.call (/app/node_modules/langchain/src/chains/base.ts:96:18)
{ message: '"不清楚"' }
Input: Hello
Entering new agent_executor chain...
{
"action": "Final Answer",
"action_input": "Hello! How can I assist you today?"
}
Finished chain.
Model response: [object Object]

@fractal-surfer
Copy link

npm restart

Should fix it. At least this worked for myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants