Closed gogogo314 closed 1 year ago
import os os.environ['OPENAI_API_KEY'] = 'sk-***Vb7' from langchain.llms import OpenAI llm = OpenAI(model_name="text-davinci-003", max_tokens=1024) llm("怎么评价人工智能")
这是我的代码
你没有修改base url吧
改了base url一样报错:
import os
from langchain.llms import OpenAI
os.environ['OPENAI_API_KEY'] ="sk-XXXX"
# os.environ['HTTP_PROXY'] = "http://api.chatanywhere.com.cn"
# os.environ['HTTPS_PROXY'] = "http://api.chatanywhere.com.cn"
os.environ['OPENAI_API_BASE'] = 'https://api.chatanywhere.com.cn/v1'
llm = OpenAI(model_name="text-davinci-003", max_tokens=1024)
llm("怎么评价人工智能")
@chatanywhere 还是不行 https://api.chatanywhere.com.cn/v1和https://api.chatanywhere.cn/v1,我都试了 我用的 我用的是 @MrRace 的代码
报错:
`Retrying langchain.llms.openai.completion_with_retry.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\陈旭坤\Desktop\kor\use_example.py", line 9, in
@gogogo314 你使用的免费key 免费key只能用embedding和gpt3
你好,我今天刚刚用这个项目申请了免费key,但是key目前已经失效了 程序报错:Incorrect API key provided: sk-EWUgz***HVxj