Open femnn opened 1 year ago
import requests
response = requests.post("http://localhost:8766/v1/chat/completions", json={"messages": messages, "model": model, "newChat": False}).json()
content = response["choices"][0]["message"]["content"]
无法使用openai官方库, 不需要设置api_key, 参考以上python代码调用
好的十分感谢,我这就试试看
之前调用api的语句是:import openai
openai.api_key = 'your-api-key'或者:set OPENAI_API_KEY=your-api-key
这种。但是现在这个网址应该怎么调用?在不同类型的代码中应该如何进行调用