Closed xiaoJack closed 1 month ago
👀 @xiaoJack
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。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。
@xiaoJack 你好!我是Dosu,一个可以帮助你解决bug、回答问题,并成为贡献者的机器人。我会在等待人类维护者的期间帮助你解决问题。
I found some similar discussions and issues that might help you resolve the "DeploymentNotFound" error:
Similar Discussions:
DEFAULT_AGENT_CONFIG
variable. The default provider is OpenAI, and you might need to change it to provider=azure
[1].Closed Issues:
To resolve the "DeploymentNotFound" error, ensure that the deployment ID (model) you are using is correct and exists in your Azure OpenAI service. Here are the steps to verify and correct the deployment:
Verify Deployment ID:
gpt-4o-mini
exists in your Azure OpenAI service.Create Azure OpenAI Instance:
import OpenAI, { ClientOptions } from 'openai';
import urlJoin from 'url-join';
import { getLLMConfig } from '@/config/llm';
import { ChatErrorType } from '@/types/fetch';
// create Azure OpenAI Instance
export const createAzureOpenai = (params: {
apiVersion?: string | null;
endpoint?: string | null;
model: string;
userApiKey?: string | null;
}) => {
const { OPENAI_PROXY_URL = '', AZURE_API_VERSION, AZURE_API_KEY } = getLLMConfig();
const endpoint = !params.endpoint ? OPENAI_PROXY_URL : params.endpoint;
const baseURL = urlJoin(endpoint, `/openai/deployments/${params.model.replace('.', '')}`);
const defaultApiVersion = AZURE_API_VERSION || '2023-08-01-preview';
const apiVersion = !params.apiVersion ? defaultApiVersion : params.apiVersion;
const apiKey = !params.userApiKey ? AZURE_API_KEY : params.userApiKey;
if (!apiKey) throw new Error('AZURE_API_KEY is empty', { cause: ChatErrorType.NoOpenAIAPIKey });
const config: ClientOptions = {
apiKey,
baseURL,
defaultHeaders: { 'api-key': apiKey },
defaultQuery: { 'api-version': apiVersion },
};
return new OpenAI(config);
};
Error Handling:
if (error.code) {
switch (error.code) {
case 'DeploymentNotFound': {
error = { ...error, deployId: model };
}
}
} else {
error = {
cause: error.cause,
message: error.message,
name: error.name,
} as any;
}
const errorType = error.code
? AgentRuntimeErrorType.ProviderBizError
: AgentRuntimeErrorType.AgentRuntimeError;
throw AgentRuntimeError.chat({
endpoint: this.maskSensitiveUrl(this.baseURL),
error,
errorType,
provider: ModelProvider.Azure,
});
By following these steps, you should be able to resolve the "DeploymentNotFound" error and ensure that your Azure OpenAI deployment is correctly configured [6][7].
To continue talking to Dosu, mention @dosu.
模型列表直接用 gpt-4o 即可,你这是环境变量中的用法。
另外“连通性测试”目前用的是 gpt-4o-mini,如果你 Azure 那边没开通,连通性测试是过不了的。
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
You can directly use gpt-4o for the model list. This is how you use it in environment variables.
模型列表直接用 gpt-4o 即可,你这是环境变量中的用法。
另外“连通性测试”目前用的是 gpt-4o-mini,如果你 Azure 那边没开通,连通性测试是过不了的。
部署名和模型名我都试了,还是同样的错误,环境变量的方式也试了,还是一样
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
You can use gpt-4o directly for the model list. This is how you use it in environment variables.
In addition, the "connectivity test" currently uses gpt-4o-mini. If you have not activated Azure, the connectivity test will not pass.
I tried both the deployment name and the model name, but still the same error. I also tried the environment variable method, but still the same error.
不要用连通性检查,直接去聊天试试。
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Don't use connectivity check, just go to chat and try.
不要用连通性检查,直接去聊天试试。
抱歉现在才回复,我刚刚试了使用部署名一直在loading,使用模型名就直接报错,我直接在mac docker部署的,在系统里面使用官方 curl 请求都正常没问题的
📦 Environment
Docker
📌 Version
v1.19.27
💻 Operating System
Other Linux
🌐 Browser
Chrome
🐛 Bug Description
您好,麻烦咨询 azure openAI 配置问题 通过浏览器配置方式
一直提示错误 { "error": { "code": "DeploymentNotFound", "message": "The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes, please wait a moment and try again.", "deployId": "gpt-4o-mini" }, "endpoint": "https://***.openai.azure.com/", "provider": "azure" }
API_KEY 和 ENDPOINT 确定了都没有错误,看了历史issues和官网配置教程没找到解决方法
📷 Recurrence Steps
No response
🚦 Expected Behavior
No response
📝 Additional Information
No response