Skip to content

Commit 9a768de

Browse files
committed
Fix linter issues
1 parent 9e24f1b commit 9a768de

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

azure/durable_functions/openai_agents/handoffs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ def from_handoff(cls, handoff: Handoff) -> "DurableHandoff":
2626
"""Create a DurableHandoff from an OpenAI agent Handoff.
2727
2828
Args:
29+
----
2930
handoff: The OpenAI agent Handoff to convert
3031
3132
Returns:
33+
-------
3234
DurableHandoff: A serializable handoff representation
3335
"""
3436
return cls(
@@ -43,6 +45,7 @@ def to_handoff(self) -> Handoff[Any, Any]:
4345
"""Create an OpenAI agent Handoff instance from this DurableHandoff.
4446
4547
Returns:
48+
-------
4649
Handoff: OpenAI agent Handoff instance
4750
"""
4851
return Handoff(
@@ -53,4 +56,3 @@ def to_handoff(self) -> Handoff[Any, Any]:
5356
strict_json_schema=self.strict_json_schema,
5457
on_invoke_handoff=lambda ctx, input: None,
5558
)
56-

azure/durable_functions/openai_agents/model_invocation_activity.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Tool,
2020
TResponseInputItem,
2121
UserError,
22-
)
22+
)
2323
from agents.items import TResponseStreamEvent
2424
from openai.types.responses.response_prompt_param import ResponsePromptParam
2525

@@ -44,14 +44,15 @@ def is_plain_text(self) -> bool:
4444
return self.output_type_name in (None, "str")
4545

4646
def name(self) -> str:
47-
"""The name of the output type."""
47+
"""Get the name of the output type."""
4848
if self.output_type_name is None:
4949
raise ValueError("Output type name has not been specified")
5050
return self.output_type_name
5151

5252
def json_schema(self) -> dict[str, Any]:
53-
"""Returns the JSON schema of the output. Will only be called if the output type is not
54-
plain text.
53+
"""Return the JSON schema of the output.
54+
55+
Will only be called if the output type is not plain text.
5556
"""
5657
if self.is_plain_text():
5758
raise UserError("Cannot provide JSON schema for plain text output types")
@@ -60,15 +61,19 @@ def json_schema(self) -> dict[str, Any]:
6061
return self.output_schema
6162

6263
def is_strict_json_schema(self) -> bool:
63-
"""Whether the JSON schema is in strict mode. Strict mode constrains the JSON schema
64-
features, but guarantees valid JSON. See here for details:
64+
"""Check if the JSON schema is in strict mode.
65+
66+
Strict mode constrains the JSON schema features, but guarantees valid JSON.
67+
See here for details:
6568
https://platform.openai.com/docs/guides/structured-outputs#supported-schemas
6669
"""
6770
return self.strict_json_schema
6871

6972
def validate_json(self, json_str: str) -> Any:
70-
"""Validate a JSON string against the output type. You must return the validated object,
71-
or raise a `ModelBehaviorError` if the JSON is invalid.
73+
"""Validate a JSON string against the output type.
74+
75+
You must return the validated object, or raise a `ModelBehaviorError` if
76+
the JSON is invalid.
7277
"""
7378
raise NotImplementedError()
7479

azure/durable_functions/openai_agents/runner.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ def _prepare_run_config(
4242
model_name = run_config.model or starting_agent.model
4343
if model_name and not isinstance(model_name, str):
4444
raise ValueError(
45-
"For agent execution in Durable Functions, model name in run_config or starting_agent must be a string."
45+
"For agent execution in Durable Functions, model name in run_config or "
46+
"starting_agent must be a string."
4647
)
4748

4849
updated_run_config = replace(

azure/durable_functions/openai_agents/tools.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,11 @@ def create_tool_from_durable_tool(
6969
OpenAI agent Tool instances that can be used during model execution.
7070
7171
Args:
72+
----
7273
durable_tool: The Durable tool definition to convert
7374
7475
Returns:
76+
-------
7577
Tool: An OpenAI agent Tool instance ready for execution
7678
7779
Raises:
@@ -107,9 +109,11 @@ def convert_tool_to_durable_tool(tool: Tool) -> DurableTool:
107109
tool definitions that can be serialized and passed to activities.
108110
109111
Args:
112+
----
110113
tool: The OpenAI agent Tool to convert
111114
112115
Returns:
116+
-------
113117
DurableTool: A serializable tool definition
114118
115119
Raises:

0 commit comments

Comments
 (0)