-
-
Notifications
You must be signed in to change notification settings - Fork 269
Feat: Add support for Pydantic's AzureProvider #168
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -253,3 +253,36 @@ def test_openai_custom_endpoint(self) -> None: | |||||||||||||||||||||||||||
| assert orch_config.model_id == "gpt-4o" | ||||||||||||||||||||||||||||
| assert orch_config.api_key == "sk-test-key" | ||||||||||||||||||||||||||||
| assert orch_config.endpoint == "https://api.custom-openai.com/v1" | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| def test_azure_openai_endpoint_configuration(self) -> None: | ||||||||||||||||||||||||||||
| """Test Azure OpenAI endpoint configuration with API version.""" | ||||||||||||||||||||||||||||
| with patch.dict( | ||||||||||||||||||||||||||||
| os.environ, | ||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||
| "ORCHESTRATOR_PROVIDER": "azure_openai", | ||||||||||||||||||||||||||||
| "ORCHESTRATOR_MODEL": "DeepSeek-V3.1", | ||||||||||||||||||||||||||||
| "ORCHESTRATOR_API_KEY": "test-azure-key", | ||||||||||||||||||||||||||||
| "ORCHESTRATOR_ENDPOINT": "https://resource.openai.azure.com/", | ||||||||||||||||||||||||||||
| "AZURE_OPEN_AI_API_VERSION": "2024-02-15-preview", | ||||||||||||||||||||||||||||
| "CYPHER_PROVIDER": "azure_openai", | ||||||||||||||||||||||||||||
| "CYPHER_MODEL": "DeepSeek-V3.1", | ||||||||||||||||||||||||||||
| "CYPHER_API_KEY": "test-azure-key", | ||||||||||||||||||||||||||||
| "CYPHER_ENDPOINT": "https://resource.openai.azure.com/", | ||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||
| ): | ||||||||||||||||||||||||||||
| config = AppConfig() | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # Test orchestrator Azure OpenAI config | ||||||||||||||||||||||||||||
| orch_config = config.active_orchestrator_config | ||||||||||||||||||||||||||||
| assert orch_config.provider == "azure_openai" | ||||||||||||||||||||||||||||
| assert orch_config.model_id == "DeepSeek-V3.1" | ||||||||||||||||||||||||||||
| assert orch_config.api_key == "test-azure-key" | ||||||||||||||||||||||||||||
| assert orch_config.endpoint == "https://resource.openai.azure.com/" | ||||||||||||||||||||||||||||
| assert orch_config.api_version == "2024-02-15-preview" | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # Test cypher Azure OpenAI config | ||||||||||||||||||||||||||||
| cypher_config = config.active_cypher_config | ||||||||||||||||||||||||||||
| assert cypher_config.provider == "azure_openai" | ||||||||||||||||||||||||||||
| assert cypher_config.model_id == "DeepSeek-V3.1" | ||||||||||||||||||||||||||||
| assert cypher_config.api_key == "test-azure-key" | ||||||||||||||||||||||||||||
| assert cypher_config.endpoint == "https://resource.openai.azure.com/" | ||||||||||||||||||||||||||||
|
Comment on lines
+283
to
+288
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test for the cypher Azure OpenAI configuration is missing an assertion for
Suggested change
|
||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment for
AZURE_OPEN_AI_API_VERSIONis placed inside the parentheses of the value assignment. This is an unconventional style and can be confusing to read. For better readability and to adhere to common Python style practices, it's recommended to place the comment on the same line after the assignment or on a separate line before it.