-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
I was following the steps described in the README.md and I couldn't make the connection with OpenAI. According to the README.md we need to do the following exports:
export OPENAI_BASE_URL=your_openai_base_url
export OPENAI_API_KEY=your_openai_api_keyAfter debugging your code, I didn't find any mechanism for the program to read it. Instead I found the following in the file openai-asure.py:
key_4 = [
{"api_base": "<api_base>", "api_key": "<api_key>", "api_version": '<api_version>'},
]
key_35 = [
{"api_base": "<api_base>", "api_key": "<api_key>", "api_version": '<api_version>'},
]
...
self.key_pool = key_4 if model.startswith('gpt-4') else key_35
...
choose_api = random.choice(self.key_pool) # -> {'api_base': '<api_base>', 'api_key': '<api_key>', 'api_version': '<api_version>'}
api_base = choose_api["api_base"]
api_key = choose_api['api_key']
api_version = choose_api['api_version']
client = AzureOpenAI(
azure_endpoint=api_base,
api_key=api_key,
api_version=api_version
)Why is choose_api picked randomly?
The values are {'api_base': '<api_base>', 'api_key': '<api_key>', 'api_version': '<api_version>'}, therefore in order to make the code work, I had to input the api_base, api_key, and api_version directly into the code.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels