Skip to content

Commit d1f8fd4

Browse files
Fix: fallback to api_key if azure_ad_token is empty (#24)
Co-authored-by: Chester Curme <[email protected]>
1 parent a40df7c commit d1f8fd4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libs/community/langchain_community/retrievers/azure_ai_search.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ def _headers(self) -> Dict[str, str]:
169169
headers = {
170170
"Content-Type": "application/json",
171171
}
172-
if not self.azure_ad_token:
172+
if self.azure_ad_token:
173173
headers["Authorization"] = f"Bearer {self.azure_ad_token}"
174-
else:
174+
elif self.api_key:
175175
headers["api-key"] = f"{self.api_key}"
176176
return headers
177177

0 commit comments

Comments
 (0)