Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions app/services/providers/azure_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ def process_streaming_chunk(chunk: bytes):
return chunk
return chunk



async def process_completion(
self,
endpoint: str,
Expand All @@ -109,6 +107,23 @@ async def process_completion(
}
return await super().process_completion(endpoint, payload, api_key, base_url, query_params)

async def process_embeddings(
self,
endpoint: str,
payload: dict[str, Any],
api_key: str,
) -> Any:
"""Process an embeddings request using Azure API"""
# Azure API requires the model to be in the path
model_id = payload["model"]
del payload["model"]
base_url = f"{self._base_url}/openai/deployments/{model_id}"

query_params = {
"api-version": self.api_version,
}
return await super().process_embeddings(endpoint, payload, api_key, base_url, query_params)

async def list_models(self, api_key: str) -> list[str]:
base_url = f"{self._base_url}/openai"
query_params = {
Expand Down
Loading