Skip to content
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
2 changes: 1 addition & 1 deletion pretty_release_notes/openai_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
)

DEFAULT_PROVIDER = "openai"
DEFAULT_MODEL = "openai:gpt-4.1"
DEFAULT_MODEL = "openai:o3"
OPENAI_MODELS_WITH_FLEX = {
"o3",
"o4-mini",
Expand Down
21 changes: 1 addition & 20 deletions tests/test_openai_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from types import SimpleNamespace
from unittest.mock import patch

from pretty_release_notes.openai_client import DEFAULT_MODEL, format_model_name, get_chat_response
from pretty_release_notes.openai_client import format_model_name, get_chat_response


def _mock_completion_response(content: str):
Expand All @@ -15,25 +15,6 @@ def _mock_completion_response(content: str):
class TestOpenAIClient:
"""Test the compatibility wrapper around any-llm."""

@patch("pretty_release_notes.openai_client.completion")
def test_default_model_is_passed_through_to_any_llm(self, mock_completion):
mock_completion.return_value = _mock_completion_response("summary")

result = get_chat_response(
content="Write a summary",
model=DEFAULT_MODEL,
api_key="test-key",
)

assert result == "summary"
mock_completion.assert_called_once_with(
messages=[{"role": "user", "content": "Write a summary"}],
model=DEFAULT_MODEL,
api_key="test-key",
client_args={"timeout": 900.0},
service_tier="auto",
)

@patch("pretty_release_notes.openai_client.completion")
def test_plain_model_defaults_to_openai_provider_for_backward_compatibility(self, mock_completion):
mock_completion.return_value = _mock_completion_response("summary")
Expand Down