Skip to content

Commit 76e5cb6

Browse files
Copilotpamelafox
andcommitted
Fix Azure OpenAI endpoint URL format for embeddings service
Co-authored-by: pamelafox <[email protected]>
1 parent 7fd57a6 commit 76e5cb6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/backend/prepdocslib/embeddings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def __init__(
168168
open_ai_custom_url: Union[str, None] = None,
169169
disable_batch: bool = False,
170170
):
171-
super().__init__(open_ai_model_name, open_ai_dimensions, disable_batch)
171+
super().__init__(open_ai_deployment or open_ai_model_name, open_ai_dimensions, disable_batch)
172172
self.open_ai_service = open_ai_service
173173
if open_ai_service:
174174
self.open_ai_endpoint = f"https://{open_ai_service}.openai.azure.com"
@@ -194,8 +194,8 @@ class AuthArgs(TypedDict, total=False):
194194
else:
195195
raise TypeError("Invalid credential type")
196196

197-
# For Azure OpenAI, we need to include the deployment in the URL
198-
base_url = f"{self.open_ai_endpoint}/openai/deployments/{self.open_ai_deployment}"
197+
# For Azure OpenAI, we need to use the v1 endpoint
198+
base_url = f"{self.open_ai_endpoint}/openai/v1"
199199

200200
return AsyncOpenAI(
201201
base_url=base_url,

0 commit comments

Comments
 (0)