Skip to content
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

Run make format #24

Closed
wants to merge 1 commit into from
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
2 changes: 1 addition & 1 deletion src/agents/agent_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def _type_to_str(t: type[Any]) -> str:
# It's a simple type like `str`, `int`, etc.
return t.__name__
elif args:
args_str = ', '.join(_type_to_str(arg) for arg in args)
args_str = ", ".join(_type_to_str(arg) for arg in args)
return f"{origin.__name__}[{args_str}]"
else:
return str(t)
1 change: 1 addition & 0 deletions src/agents/model_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class ModelSettings:
This class holds optional model configuration parameters (e.g. temperature,
top_p, penalties, truncation, etc.).
"""

temperature: float | None = None
top_p: float | None = None
frequency_penalty: float | None = None
Expand Down
2 changes: 1 addition & 1 deletion tests/src/agents/agent_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def _type_to_str(t: type[Any]) -> str:
# It's a simple type like `str`, `int`, etc.
return t.__name__
elif args:
args_str = ', '.join(_type_to_str(arg) for arg in args)
args_str = ", ".join(_type_to_str(arg) for arg in args)
return f"{origin.__name__}[{args_str}]"
else:
return str(t)
1 change: 1 addition & 0 deletions tests/src/agents/model_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class ModelSettings:
This class holds optional model configuration parameters (e.g. temperature,
top_p, penalties, truncation, etc.).
"""

temperature: float | None = None
top_p: float | None = None
frequency_penalty: float | None = None
Expand Down
9 changes: 6 additions & 3 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,16 @@ def test_resp_set_default_openai_client():


def test_set_default_openai_api():
assert isinstance(OpenAIProvider().get_model("gpt-4"), OpenAIResponsesModel), \
assert isinstance(OpenAIProvider().get_model("gpt-4"), OpenAIResponsesModel), (
"Default should be responses"
)

set_default_openai_api("chat_completions")
assert isinstance(OpenAIProvider().get_model("gpt-4"), OpenAIChatCompletionsModel), \
assert isinstance(OpenAIProvider().get_model("gpt-4"), OpenAIChatCompletionsModel), (
"Should be chat completions model"
)

set_default_openai_api("responses")
assert isinstance(OpenAIProvider().get_model("gpt-4"), OpenAIResponsesModel), \
assert isinstance(OpenAIProvider().get_model("gpt-4"), OpenAIResponsesModel), (
"Should be responses model"
)