Open AprilJoy opened 2 months ago
@AprilJoy Try calling the openai API on its own with this api key and see if you get the same error
@penguine-ip
I used this and can get the correct respond.
import os import json from openai import OpenAI messages= [ {"role": "user", "content": "你好,一个高级工程师想学习 Azure,他已经有 10 年的开发经验,可以用哪些资料做参考"} ]
client = OpenAI(
api_key= api_key, base_url = "https://burn.hair/v1" )
response = client.chat.completions.create(model="gpt-3.5-turbo", messages=messages ) print(response.choices[0].message)
I encounter this problem too. I can't find a place to set base_url for api_key.
❗BEFORE YOU BEGIN❗ Are you on discord? 🤗 We'd love to have you asking questions on discord instead: https://discord.com/invite/a3K9c8GRGt Yes
Describe the bug I get the error info: AuthenticationError: Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-*** You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}} I use the base_url setting, but where can I set the base_url? I did not find the method in toturial.
To Reproduce Steps to reproduce the behavior:
Expected behavior How can I set the OPENAI configure "base_url" in the deepeval SDK?
Screenshots If applicable, add screenshots to help explain your problem.