Porkey
instance and passing a dummy. But my completion request is still failing:completion = portkey.chat.completions.create(messages = [{ "role": 'user', "content": 'Say this is a test' }]) ValidationError: 1 validation error for ChatCompletions choices field required (type=value_error.missing)
Tried undefined time(s) but failed. Error: {"cause":{"errno":-3008,"code":"ENOTFOUND","syscall":"getaddrinfo","hostname":"MY AZURE endpoint url"}}
Portkey
instance:portkey = Portkey(provider = "azure-openai", base_url="http://localhost:8787/v1", azure_resource_name = "resource-gpt4-turbo-us-west", azure_deploymend_id = "https://gpt4-turbo-west-us.openai.azure.com/", azure_api_version = "2023-12-01-preview", authorization="xxxxxxxzzzzyyyyyyyy", api_key="dummy")
completion
somewhere - wanted to check if that's causing any issues"Bearer "
prefix. But it's still giving the same error.completion
because this command:completion = portkey.chat.completions.create(messages = [{ "role": 'user', "content": 'Say this is a test' }])
completion
variable is not initialized.from openai import OpenAI portkey = OpenAI( api_key="YOUR_AZURE_OPENAI_API_KEY", base_url="http://localhost:8787/v1", default_headers={ 'x-portkey-azure-resource-name': '....', 'x-portkey-azure-deployment-id': '....', 'x-portkey-azure-api-version': '....', 'x-portkey-provider': 'azure-openai' } ) completion = portkey.chat.completions.create( messages= [{ "role": 'user', "content": 'Say this is a test' }], model="gpt-4o" ) print(completion.choices[0].message.content)