Closed wei851246721 closed 7 months ago
请问如果我i使用的API不是直接连接到openai api而是经过中转的接口,调用前需要转换,在你的程序里需要修改哪里呢?
下面是中转站给的示例: from openai import OpenAI
api_key = "xxx" api_base = "https://one.aiskt.com/v1" client = OpenAI(api_key=api_key, base_url=api_base)
completion = client.chat.completions.create( model="gpt-3.5-turbo", messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Hello!"} ] )
print(completion.choices[0].message)
https://github.com/wxywb/history_rag/issues/10
非常感谢,现在可以了
非常有用,感谢
请问如果我i使用的API不是直接连接到openai api而是经过中转的接口,调用前需要转换,在你的程序里需要修改哪里呢?
下面是中转站给的示例: from openai import OpenAI
api_key = "xxx" api_base = "https://one.aiskt.com/v1" client = OpenAI(api_key=api_key, base_url=api_base)
completion = client.chat.completions.create( model="gpt-3.5-turbo", messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Hello!"} ] )
print(completion.choices[0].message)