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
希望能得到调试
更多回答
优秀答案推荐
我是一名优秀的程序员,十分优秀!