Welcome to Portkey Forum

Home
Members
artyabra
a
artyabra
Offline, last seen 3 weeks ago
Joined November 4, 2024
Ok it seems like it worked like this:
Plain Text
config = {
    'retry': {'attempts': 1, 'on_status_codes': [429]},
    'provider': 'azure-openai',
    'resource_name': '___',
    'deployment_id': '___',
    'api_version': '2023-12-01-preview',
    'api_key': '___'
}
1 comment
V
@Vrushank | Portkey
OK, so I didn't get an error now when creating the Porkey instance and passing a dummy. But my completion request is still failing:
Plain Text
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)
8 comments
a
V
@Vrushank | Portkey
If I'm not passing any value to the api_key argument, and instead pass my azure api key to the authorization argument, then I get the following error:
Plain Text
ValueError: No API key found for Portkey.
Please set either the PORTKEY_API_KEY environment variable or pass the api_key prior to initialization of Portkey.
API keys can be found or created at Portkey Dashboard 
Here's how you get it:
1. Visit https://app.portkey.ai/
1. Click on your profile icon on the top left
2. From the dropdown menu, click on "Copy API Key"
1 comment
V