Skip to content

Commit

Permalink
fix: using 'openai' api type instead of 'azure' for mistral (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
adubovik authored Apr 23, 2024
1 parent da30226 commit 1c7a05f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion aidial_adapter_openai/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ async def chat_completion(deployment_id: str, request: Request):
)
elif deployment_id in mistral_deployments:
return await handle_exceptions(
mistral_chat_completion(data, upstream_endpoint, api_key, api_type)
mistral_chat_completion(data, upstream_endpoint, api_key)
)
elif deployment_id in databricks_deployments:
return await handle_exceptions(
Expand Down
9 changes: 2 additions & 7 deletions aidial_adapter_openai/mistral.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,13 @@ async def generate_stream(
yield END_CHUNK


async def chat_completion(
data: Any,
upstream_endpoint: str,
api_key: str,
api_type: str,
):
async def chat_completion(data: Any, upstream_endpoint: str, api_key: str):
data["model"] = "azureai"

response = await ChatCompletion().acreate(
api_key=api_key,
api_base=upstream_endpoint,
api_type=api_type,
api_type="openai",
request_timeout=DEFAULT_TIMEOUT,
**data,
)
Expand Down

0 comments on commit 1c7a05f

Please sign in to comment.