Skip to content

Commit 1079faa

Browse files
Tighten image generation typing and sample tools list
Co-authored-by: eavanvalkenburg <[email protected]>
1 parent 3238043 commit 1079faa

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

‎python/packages/core/agent_framework/openai/_responses_client.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ def _parse_response_from_openai(
751751
)
752752
case "code_interpreter_call": # ResponseOutputCodeInterpreterCall
753753
call_id = getattr(item, "call_id", None) or getattr(item, "id", None)
754-
outputs: list[Contents] = []
754+
outputs: list["Contents"] = []
755755
if hasattr(item, "outputs") and item.outputs:
756756
for code_output in item.outputs:
757757
if getattr(code_output, "type", None) == "logs":

‎python/samples/getting_started/agents/openai/openai_responses_client_image_generation.py‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,14 @@ async def main() -> None:
5050
# Create an agent with customized image generation options
5151
agent = OpenAIResponsesClient().create_agent(
5252
instructions="You are a helpful AI that can generate images.",
53-
tools=HostedImageGenerationTool(
54-
options={
55-
"size": "1024x1024",
56-
"output_format": "webp",
57-
}
58-
),
53+
tools=[
54+
HostedImageGenerationTool(
55+
options={
56+
"size": "1024x1024",
57+
"output_format": "webp",
58+
}
59+
)
60+
],
5961
)
6062

6163
query = "Generate a nice beach scenery with blue skies in summer time."

0 commit comments

Comments
 (0)