lobe-chat icon indicating copy to clipboard operation
lobe-chat copied to clipboard

[Bug] DEFAULT_AGENT_CONFIG配置对随便聊聊无效,必须要再选择一下才能生效

Open xiangnanscu opened this issue 1 year ago • 3 comments

📦 部署环境

Other

📌 软件版本

Latest

💻 系统环境

Ubuntu

🌐 浏览器

Chrome

🐛 问题描述

.env文件里面配置DEFAULT_AGENT_CONFIG="model=gemini-2.0-flash-exp", 模型无效. 用户必须在网页上再点选一次才能生效 b6

📷 复现步骤

  1. .env文件里面配置DEFAULT_AGENT_CONFIG="model=gemini-2.0-flash-exp"
  2. 用户扫码登陆
  3. 对话框上方显示的是gemini-2.0-flash-exp, 然后用户点击随便聊聊, 开始对话
  4. 出错, 提示openai的错误

🚦 期望结果

用户登陆之后,直接对话就是按DEFAULT_AGENT_CONFIG指定的模型

📝 补充信息

No response

xiangnanscu avatar Dec 29 '24 13:12 xiangnanscu

👀 @xiangnanscu

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

lobehubbot avatar Dec 29 '24 13:12 lobehubbot

I found a similar closed issue that might be relevant to your problem. The issue titled "[Bug] DEFAULT_AGENT_CONFIG失效" was closed after a pull request fixed the problem where the DEFAULT_AGENT_CONFIG was not working correctly on new devices. The fix was implemented in version 0.150.2, which addressed a display error when using the DEFAULT_AGENT_CONFIG environment variable [1].

The changes included tests to ensure that the getDefaultAgentConfig function correctly parses the DEFAULT_AGENT_CONFIG environment variable, returning configurations such as enableAutoCreateTopic, model, plugins, and provider as expected [2].

It might be helpful to check if your issue is related to how the DEFAULT_AGENT_CONFIG is being parsed or applied in your environment. Ensure that the configuration is correctly set in the .env file and that there are no additional conditions or dependencies affecting its application during the initial login or session start.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

dosubot[bot] avatar Dec 29 '24 13:12 dosubot[bot]

截图遮了, 这里再贴一下用户点选之前尝试对话的提示信息:

请求 OpenAI 服务出错,请根据以下信息排查或重试
json
{
  "error": {
    "code": "model_not_found",
    "type": "invalid_request_error",
    "param": null,
    "message": "The model `gemini-2.0-flash-exp` does not exist or you do not have access to it."
  },
  "endpoint": "https://api.openai.com/v1",
  "provider": "openai"
}

xiangnanscu avatar Dec 29 '24 13:12 xiangnanscu

加一下 provider=google

arvinxx avatar Dec 29 '24 14:12 arvinxx

✅ @xiangnanscu

This issue is closed, If you have any questions, you can comment and reply.
此问题已经关闭。如果您有任何问题,可以留言并回复。

lobehubbot avatar Dec 29 '24 14:12 lobehubbot

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Add provider=google

lobehubbot avatar Dec 29 '24 14:12 lobehubbot

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Oct 01 '25 01:10 github-actions[bot]