Skip to content
Closed
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
4 changes: 1 addition & 3 deletions src/agents/models/chatcmpl_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ def is_openai(cls, client: AsyncOpenAI) -> bool:

@classmethod
def get_store_param(cls, client: AsyncOpenAI, model_settings: ModelSettings) -> bool | None:
# Match the behavior of Responses where store is True when not given
default_store = True if cls.is_openai(client) else None
return model_settings.store if model_settings.store is not None else default_store
return model_settings.store

@classmethod
def get_stream_options_param(
Expand Down
6 changes: 3 additions & 3 deletions tests/models/test_openai_chatcompletions.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,12 +577,12 @@ def __init__(self, completions: DummyCompletions) -> None:


def test_store_param():
"""Should default to True for OpenAI API calls, and False otherwise."""
"""Should omit store unless it is explicitly set."""

model_settings = ModelSettings()
client = AsyncOpenAI()
assert ChatCmplHelpers.get_store_param(client, model_settings) is True, (
"Should default to True for OpenAI API calls"
assert ChatCmplHelpers.get_store_param(client, model_settings) is None, (
"Should omit store when not specified for Chat Completions"
)

model_settings = ModelSettings(store=False)
Expand Down