danny-avila / LibreChat

Enhanced ChatGPT Clone: Features Anthropic, AWS, OpenAI, Assistants API, Azure, Groq, o1, GPT-4o, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, langchain, DALL-E-3, ChatGPT Plugins, OpenAI Functions, Secure Multi-User System, Presets, completely open-source for self-hosting. Actively in public development.
https://librechat.ai/
MIT License
19.41k stars 3.24k forks source link

[Bug]: Agent stops working: "The AI service rejected the request due to an error. This could be caused by an invalid API key or an improperly formatted request." #4811

Open leondape opened 4 hours ago

leondape commented 4 hours ago

What happened?

I've built multiple agents with tools (Dalle but also custom tools) All Chats with various agents get this bug after a while. From that point on such a chat is completely broken. You must start a new chat, otherwise you will always receive the error.

I cannot pin down what is causing it: Tool usage, long system prompts, or a specific model. For now I think it happens on all cases. I have the feeling that the issue appears more on longer chats, but I am absolutely not sure about that. I belive it hast nothing to do with any API key, as it just happens!

Steps to Reproduce

  1. Create Agent with approx. 1000 Token Prompt instruction
  2. Attach any Plugin
  3. Chat for a while
  4. wait for the error

What browsers are you seeing the problem on?

No response

Relevant log output

2024-11-29 13:44:50 error: [api/server/controllers/agents/client.js #sendCompletion] Unhandled error type 400 Invalid value for 'content': expected a string, got null.
2024-11-29 13:44:50 error: [handleAbortError] AI response error; aborting request: 400 Invalid value for 'content': expected a string, got null.

Screenshots

Bildschirmfoto 2024-11-29 um 14 47 41

Code of Conduct