gpt4 book ai didi

Open AI error: "InvalidRequestError: Resource not found"(打开AI错误:“InvalidRequestError:找不到资源”)

转载 作者:bug小助手 更新时间:2023-10-25 14:49:57 24 4
gpt4 key购买 nike



The code I was copy from other people, the purpose of code is testing AzureOpenai API.However I am facing some error.

我的代码是从别人那里复制的,代码的目的是测试AzureOpenai API。但是我遇到了一些错误。


`from langchain.llms import AzureOpenAI
import os
import openai

openai.api_key = os.getenv("<API_KEY>")
openai.api_base = os.getenv("https://. .openai.azure.com/") # your endpoint should look like the following https://YOUR_RESOURCE_NAME.openai.azure.com/
openai.api_type = 'azure'
openai.api_version = '2023-03-15-preview'


os.environ["OPENAI_API_TYPE"] = OPENAI_API_TYPE
os.environ["OPENAI_API_VERSION"] = OPENAI_API_VERSION
os.environ["OPENAI_API_BASE"] = OPENAI_API_BASE
os.environ["OPENAI_API_KEY"] = OPENAI_API_KEY

llm = AzureOpenAI(
# openai_api_type="azure",
deployment_name="text-davinci-003",
model_name="text-davinci-003")

print(llm("hi"))`

The output is this one

输出是这样的


InvalidRequestError: Resource not found

I have checked my endpoint website, but the outcome is
{"error":{"code":"404","message": "Resource not found"}} in website

我已经检查了我的终结点网站,但结果是网站中的{“Error”:{“code”:“404”,“Message”:“Resource Not Found”}


Hopefully can get debug

希望能得到调试


更多回答
优秀答案推荐

Langchain's AzureOpenAI error: Resource not found

LangChain的AzureOpenAI错误:找不到资源


What worked for me was removing the import of openai when using the langchain.llms.AzureOpenAI module.

对我来说起作用的是在使用langchain.llms.AzureOpenAI模块时删除了OpenAI的导入。


更多回答

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com