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

[Bug] The environment variable DEFAULT_MODEL configuration is invalid #5947

Open
chiachan163 opened this issue Dec 18, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@chiachan163
Copy link

📦 Deployment Method

Vercel

📌 Version

v2.15.8

💻 Operating System

Other

📌 System Version

vercel

🌐 Browser

Chrome

📌 Browser Version

131.0.6778.140

🐛 Bug Description

fetch("/api/config", {
        method: "post",
        body: null,
        headers: {
          ...getHeaders(),
        },
      })
        .then((res) => res.json())
        .then((res) => {
          const defaultModel = res.defaultModel ?? "";
          if (defaultModel !== "") {
            const [model, providerName] = getModelProvider(defaultModel);
            DEFAULT_CONFIG.modelConfig.model = model;
            DEFAULT_CONFIG.modelConfig.providerName = providerName as any;
          }

          return res;
        })

配置了环境变量DEFAULT_MODEL=gpt-3.5-turbo@OpenAi ,发现不生效。
看来源码,是有处理的。
8039eb92588be0c54427f4377e68a52e

最后定位到这里,发现是接口返回数据并没有写入。所以取数据还是默认值gpt-4o-mini

📷 Recurrence Steps

No response

🚦 Expected Behavior

No response

📝 Additional Information

No response

@chiachan163 chiachan163 added the bug Something isn't working label Dec 18, 2024
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: [Bug] The environment variable DEFAULT_MODEL configuration is invalid

@chiachan163 chiachan163 changed the title [Bug] 环境变量DEFAULT_MODEL配置无效 [Bug] The environment variable DEFAULT_MODEL configuration is invalid Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants