Skip to content

Python: fix: Remove wrong response_format override in AzureChatPromptExecutionSettings class #6424

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

Merged
merged 2 commits into from
May 29, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,4 @@ def __getitem__(self, item):
class AzureChatPromptExecutionSettings(OpenAIChatPromptExecutionSettings):
"""Specific settings for the Azure OpenAI Chat Completion endpoint."""

response_format: str | None = None
extra_body: dict[str, Any] | ExtraBody | None = None
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,10 @@ def test_azure_open_ai_chat_prompt_execution_settings_with_aisearch_data_sources
}
settings = AzureChatPromptExecutionSettings.model_validate(input_dict, strict=True, from_attributes=True)
assert settings.extra_body["dataSources"][0]["type"] == "AzureCognitiveSearch"


def test_azure_open_ai_chat_prompt_execution_settings_with_response_format_json():
response_format = {"type": "json_object"}
settings = AzureChatPromptExecutionSettings(response_format=response_format)
options = settings.prepare_settings_dict()
assert options["response_format"] == response_format
Loading