-
I would like to customize the api address of openai because I can't use the services of openai directly in my location. I'm going to use nginx to proxy openai's api address, and then change the request address to my proxy api address |
Beta Was this translation helpful? Give feedback.
Answered by
zainhoda
Feb 23, 2024
Replies: 1 comment
-
Yes, you can pass in your own OpenAI client object where you specify the endpoint. class MyVanna(ChromaDB_VectorStore, OpenAI_Chat):
def __init__(self, config=None):
ChromaDB_VectorStore.__init__(self, config=config)
OpenAI_Chat.__init__(self, client=YOUR_OPENAI_CLIENT, config=config) # Make sure to put your AzureOpenAI client here
vn = MyVanna(config={'model': 'gpt-4-...'}) Alternatively, you can set your https://github.com/openai/openai-python/blob/main/src/openai/_client.py#L306 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
zainhoda
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, you can pass in your own OpenAI client object where you specify the endpoint.
Alternatively, you can set your
OPENAI_BASE_URL
environment variablehttps://github.com/openai/openai-python/blob/main/src/openai/_client.py#L306