Skip to content

Commit

Permalink
fix: used propagate_auth_headers from SDK to propagate Authorization …
Browse files Browse the repository at this point in the history
…header automatically
  • Loading branch information
adubovik committed Sep 9, 2024
1 parent 908c4e7 commit ec3298a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion aidial_interceptors_sdk/dial_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ async def create(
client = AsyncAzureOpenAI(
azure_endpoint=DIAL_URL,
azure_deployment="interceptor",
api_key=api_key,
# NOTE: DIAL SDK takes care of propagating auth headers
api_key="dummy",
# NOTE: api-version query parameter is not required in the chat completions DIAL API.
# However, it is required in Azure OpenAI API, that's why the openai library fails when it's missing:
# https://github.com/openai/openai-python/blob/9850c169c4126fd04dc6796e4685f1b9e4924aa4/src/openai/lib/azure.py#L174-L177
Expand Down
1 change: 1 addition & 0 deletions aidial_interceptors_sdk/examples/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
description="Examples of DIAL interceptors",
telemetry_config=TelemetryConfig(),
add_healthcheck=True,
propagate_auth_headers=True,
)

configure_loggers()
Expand Down

0 comments on commit ec3298a

Please sign in to comment.