-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed as not planned
Labels
questionFurther information is requestedFurther information is requested
Description
Confirm this is an issue with the Python library and not an underlying OpenAI API
- This is an issue with the Python library
Describe the bug
Hello, I'm encountering an issue with my program EasyTranslator.
if len(self.api_proxy) == 0:
print("-" * 3)
print(f"\033[1;32mOpenAI API proxy not detected, currently using the api address: {openai.api_base}\033[0m")
else:
self.api_proxy_url = self.api_proxy + "/v1"
openai.api_base = os.environ.get("OPENAI_API_BASE", self.api_proxy_url)
print("-" * 3)
print(f"\033[1;32mUsing OpenAI API proxy, the proxy address is: {openai.api_base}\033[0m")
The program consistently throws an error:
AttributeError: module 'openai' has no attribute 'api_base'. Did you mean: 'api_type'?
I also noticed that this attribute is indeed missing, as shown in the image below:
Could you please clarify if there's another attribute used in place of 'api_base,' or if it's deprecated?
Additionally, I'm using Azure to call the openai API's openai.api_base.
How should I address this problem? Thank you very much!
To Reproduce
- git clone https://github.com/artwalker/EasyTranslator.git
- cd EasyTranslator
- pip install -r preconditions.txt
- python easy_translator.py ./book/profile.txt
Code snippets
No response
OS
win 11
Python version
Python 3.12.0
Library version
openai v1.2.3
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested