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.

Home Page:https://librechat.ai/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Experimental Agents broken with custom endpoints

returnofblank opened this issue · comments

What happened?

Note: This is only tested with OpenRouter, this may not apply to other custom endpoints. Unfortunately I do not have the resources to try with something else.

When choosing a custom endpoint in the agent creation menu, and then choosing a model (any model from what I found), exiting out will lead to this error.

Unexpected Application Error!
n.toLowerCase is not a function
i_@https://mydomain.example/assets/index.DOfEXLPm.js:3128:22877
A7@https://mydomain.example/assets/vendor.BujiSg_e.js:38:19557
Qee@https://mydomain.example/assets/vendor.BujiSg_e.js:40:44171
zee@https://mydomain.example/assets/vendor.BujiSg_e.js:40:39879
pSe@https://mydomain.example/assets/vendor.BujiSg_e.js:40:39802
v2@https://mydomain.example/assets/vendor.BujiSg_e.js:40:39648
j$@https://mydomain.example/assets/vendor.BujiSg_e.js:40:36004
iB@https://mydomain.example/assets/vendor.BujiSg_e.js:40:36809
Kf@https://mydomain.example/assets/vendor.BujiSg_e.js:38:3288
Vo/<@https://mydomain.example/assets/vendor.BujiSg_e.js:40:34324

I have no concrete theory as to what is causing this. But I assume something on the front end is passing a broken input to the chatCompletion function at api/server/controllers/agents/client.js since the error appears in the logs.

Again, this theory is mostly baseless. I unfortunately do not have the time to go more in depth, as I wish to rewatch The Orville at this moment, not make another issue.

Steps to Reproduce

  1. Create a custom endpoint (for me, OpenRouter)
  2. Under the Model option, choose the custom endpoint provider
  3. Set the actual model to anything, not sure it matters
  4. Click the back arrow to return to the previous screen
  5. Error will appear

What browsers are you seeing the problem on?

No response

Relevant log output

2024-10-02T02:03:46.493Z debug: [api/server/controllers/agents/client.js] chatCompletion
{
  baseURL: undefined,
  // 1 payload(s)
  payload: [{"role":"user","content":"\nUnexpected Application Error!\nn.toLowerCase is not a function\ni_@ht... [truncated]],
}

Screenshots

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

I also didn't see this when I first made the issue, but someone on the discord is also experiencing the issue.

So it's not an isolated incident with my f*cked up config at least.

image

I will confirm that I had the issue. I use custom and litellm as a backend.