Mintplex-Labs / anything-llm

The all-in-one Desktop & Docker AI application with built-in RAG, AI agents, and more.
https://anythingllm.com
MIT License
27.48k stars 2.77k forks source link

Rework failover agent invocation selection for agent and ephemmeral agent #2515

Closed timothycarambat closed 1 month ago

timothycarambat commented 1 month ago

Pull Request Type

Relevant Issues

resolves #2514

What is in this change?

use the explicitly set agentProvider and agentModel combination. No verification is done to confirm the pairing is valid, just that it exists. The API will return any errors anyway.

Fallback to the workspaces chatProvider and chatModel overrides, this at least keeps answers within the same model preference the user-defined for a workspace.

Lastly, attempt to use the LLM_PROVIDER env and its ENV default model. If no ENV preference can be found - assume a static model string that is generally available for the provider. If that cannot be determined - return null and probably exit since most LLM providers do not accept null for model.

Additional Information

Developer Validations