Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deployment_name param updated to deployment_id #620

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion docs/configuration/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ To use the Azure OpenAI service, you can set the following configuration options
| --- | --- | --- | :---: | --- |
| API key | `MARVIN_AZURE_OPENAI_API_KEY` | `marvin.settings.azure_openai.api_key` | ✅ | |
| API base | `MARVIN_AZURE_OPENAI_API_BASE` | `marvin.settings.azure_openai.api_base` | ✅ | The API endpoint; this should have the form `https://YOUR_RESOURCE_NAME.openai.azure.com` |
| Deployment name | `MARVIN_AZURE_OPENAI_DEPLOYMENT_NAME` | `marvin.settings.azure_openai.deployment_name` | ✅ | |
| Deployment name | `MARVIN_AZURE_OPENAI_DEPLOYMENT_ID` | `marvin.settings.azure_openai.deployment_id` | ✅ | |
| API type | `MARVIN_AZURE_OPENAI_API_TYPE` | `marvin.settings.azure_openai.api_type` | | Either `azure` (the default) or `azure_ad` (to use Microsoft Active Directory to authenticate to your Azure endpoint).|

### Using a model
Expand Down
6 changes: 2 additions & 4 deletions src/marvin/engine/language_models/azure_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ def _get_openai_settings(self) -> dict:
"Azure OpenAI API key not set. Please set it or use the"
" MARVIN_AZURE_OPENAI_API_KEY environment variable."
)
if marvin.settings.azure_openai.deployment_name:
openai_kwargs["deployment_name"] = (
marvin.settings.azure_openai.deployment_name
)
if marvin.settings.azure_openai.deployment_id:
openai_kwargs["deployment_id"] = marvin.settings.azure_openai.deployment_id
if marvin.settings.azure_openai.api_type:
openai_kwargs["api_type"] = marvin.settings.azure_openai.api_type
if marvin.settings.azure_openai.api_base:
Expand Down
4 changes: 2 additions & 2 deletions src/marvin/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ class Config:
# "The endpoint of the Azure OpenAI API. This should have the form https://YOUR_RESOURCE_NAME.openai.azure.com" # noqa
api_base: Optional[str] = None
api_version: Optional[str] = "2023-07-01-preview"
# `deployment_name` will correspond to the custom name you chose for your deployment when # noqa
# `deployment_id` will correspond to the custom name you chose for your deployment when # noqa
# you deployed a model.
deployment_name: Optional[str] = None
deployment_id: Optional[str] = None

def get_defaults(self, settings: "Settings") -> dict[str, Any]:
import os
Expand Down
Loading