You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ChatCompletionClient.load_component support default-headers
Why is this needed?
When I use AzureOpenAIChatCompletionClient and pass the below parameters, the code is working fine,
model_client = AzureOpenAIChatCompletionClient(
model = "gpt-4o-2024-05-13",
azure_deployment= 'xxxxxx',
azure_endpoint = 'xxxxxx',
api_version = 'xxxx',
api_key = os.getenv("AZURE_API_KEY"),
default_headers = {'X-User-Id': os.getlogin()}
)
but when I use ChatCompletionClient.load_component, and pass the config:
{'provider': 'AzureOpenAIChatCompletionClient', 'config': {'model': 'xxxxx', 'azure_endpoint': 'xxxx', 'azure_deployment': 'xxxxx', 'api_version': 'xxxx', 'api_key': 'xxxxx', 'default_headers': {'X-User-Id': 'xxxxxx'}}}
it seems there is no way can pass the default_headers property, so meet the below error:
openai.PermissionDeniedError: Error code: 403 - {'error': {'code': '403', 'message': 'The X-User-Id request header is now mandatory for cost allocation. Please set the parameter with "xxxxx" for allocating to the end user's department or "srv_xxxx" for background jobs.'}}
The text was updated successfully, but these errors were encountered:
What feature would you like to be added?
ChatCompletionClient.load_component support default-headers
Why is this needed?
When I use AzureOpenAIChatCompletionClient and pass the below parameters, the code is working fine,
model_client = AzureOpenAIChatCompletionClient(
model = "gpt-4o-2024-05-13",
azure_deployment= 'xxxxxx',
azure_endpoint = 'xxxxxx',
api_version = 'xxxx',
api_key = os.getenv("AZURE_API_KEY"),
default_headers = {'X-User-Id': os.getlogin()}
)
but when I use ChatCompletionClient.load_component, and pass the config:
{'provider': 'AzureOpenAIChatCompletionClient', 'config': {'model': 'xxxxx', 'azure_endpoint': 'xxxx', 'azure_deployment': 'xxxxx', 'api_version': 'xxxx', 'api_key': 'xxxxx', 'default_headers': {'X-User-Id': 'xxxxxx'}}}
it seems there is no way can pass the default_headers property, so meet the below error:
openai.PermissionDeniedError: Error code: 403 - {'error': {'code': '403', 'message': 'The X-User-Id request header is now mandatory for cost allocation. Please set the parameter with "xxxxx" for allocating to the end user's department or "srv_xxxx" for background jobs.'}}
The text was updated successfully, but these errors were encountered: