Skip to content

Commit

Permalink
Merge pull request #786 from PrefectHQ/setting-prefix
Browse files Browse the repository at this point in the history
fix setting prefix
  • Loading branch information
zzstoatzz authored Jan 18, 2024
2 parents 6e95089 + c1b0456 commit c49ce89
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cookbook/azure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ MARVIN_AZURE_OPENAI_API_KEY=<your-api-key>
MARVIN_AZURE_OPENAI_ENDPOINT="https://<your-endpoint>.openai.azure.com/"
MARVIN_AZURE_OPENAI_API_VERSION=2023-12-01-preview # or latest

MARVIN_CHAT_COMPLETION_MODEL=<your azure openai deployment name>
MARVIN_CHAT_COMPLETIONS_MODEL=<your azure openai deployment name>
```

Note that the chat completion model must be your Azure OpenAI deployment name.
Expand Down
2 changes: 1 addition & 1 deletion cookbook/azure/usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
MARVIN_AZURE_OPENAI_API_VERSION=2023-12-01-preview # or latest
Note that you MUST set the LLM model name to be your Azure OpenAI deployment name, e.g.
MARVIN_CHAT_COMPLETION_MODEL=<your Azure OpenAI deployment name>
MARVIN_CHAT_COMPLETIONS_MODEL=<your Azure OpenAI deployment name>
```
"""

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/configuration/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ A runtime settings object is accessible via `marvin.settings` and can be used to
```python
import marvin

marvin.settings.openai_chat_completions_model = 'gpt-4'
marvin.settings.openai.chat.completions.model = 'gpt-4'
```

## Settings for using Azure OpenAI models
Expand All @@ -38,7 +38,7 @@ MARVIN_AZURE_OPENAI_API_KEY=<your-api-key>
MARVIN_AZURE_OPENAI_ENDPOINT="https://<your-endpoint>.openai.azure.com/"
MARVIN_AZURE_OPENAI_API_VERSION=2023-12-01-preview # or latest

MARVIN_CHAT_COMPLETION_MODEL=<your azure openai deployment name>
MARVIN_CHAT_COMPLETIONS_MODEL=<your azure openai deployment name>
```

Note that the chat completion model must be your Azure OpenAI deployment name.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ filterwarnings = [
env = [
"MARVIN_TEST_MODE=1",
# use 3.5 for tests by default
'D:MARVIN_CHAT_COMPLETION_MODEL=gpt-3.5-turbo',
'D:MARVIN_CHAT_COMPLETION_TEMPERATURE=0.0',
'D:MARVIN_CHAT_COMPLETIONS_MODEL=gpt-3.5-turbo',
'D:MARVIN_CHAT_COMPLETIONS_TEMPERATURE=0.0',
'D:MARVIN_LOG_VERBOSE=1',
'D:MARVIN_LOG_LEVEL=DEBUG',
'PYTEST_TIMEOUT=20',
Expand Down
2 changes: 1 addition & 1 deletion src/marvin/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __setattr__(self, name: str, value: Any) -> None:


class ChatCompletionSettings(MarvinSettings):
model_config = SettingsConfigDict(env_prefix="marvin_chat_completion_")
model_config = SettingsConfigDict(env_prefix="marvin_chat_completions_")
model: str = Field(
description="The default chat model to use.", default="gpt-4-1106-preview"
)
Expand Down
2 changes: 1 addition & 1 deletion src/marvin/utilities/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def get_openai_client(
- MARVIN_AZURE_OPENAI_ENDPOINT
In addition, you must set the LLM model name to your Azure OpenAI deployment name, e.g.
- MARVIN_CHAT_COMPLETION_MODEL = <your Azure OpenAI deployment name>
- MARVIN_CHAT_COMPLETIONS_MODEL = <your Azure OpenAI deployment name>
"""
)
)
Expand Down

0 comments on commit c49ce89

Please sign in to comment.