Skip to content

Commit

Permalink
Python: response format fix (microsoft#4479)
Browse files Browse the repository at this point in the history
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
  • Loading branch information
eavanvalkenburg committed Jan 4, 2024
1 parent 7f68a88 commit 833a2d7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def check_best_of_and_n(self) -> "OpenAITextRequestSettings":
class OpenAIChatRequestSettings(OpenAIRequestSettings):
"""Specific settings for the Chat Completion endpoint."""

response_format: Optional[Literal["text", "json_object"]] = "text"
response_format: Optional[Dict[Literal["type"], Literal["text", "json_object"]]] = None
tools: Optional[List[Dict[str, Any]]] = None
tool_choice: Optional[str] = None
function_call: Optional[str] = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def test_default_openai_chat_request_settings():
assert settings.number_of_responses == 1
assert settings.logit_bias == {}
assert settings.messages[0]["content"] == "Assistant is a large language model."
assert settings.response_format == "text"


def test_custom_openai_chat_request_settings():
Expand Down

0 comments on commit 833a2d7

Please sign in to comment.