Skip to content

Commit 4ddd0d9

Browse files
fix for 3.10 mypy
1 parent 417ea2c commit 4ddd0d9

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -995,9 +995,8 @@ def _parse_response_from_openai(
995995
# item.result contains raw base64 string
996996
# so we call detect_media_type_from_base64 to get the media type and fallback to image/png
997997
image_output = Content.from_uri(
998-
uri=f"data:{(detect_media_type_from_base64(data_str=item.result) or 'image/png')};base64,{
999-
item.result
1000-
}",
998+
uri=f"data:{detect_media_type_from_base64(data_str=item.result) or 'image/png'}"
999+
f";base64,{item.result}",
10011000
raw_representation=item.result,
10021001
)
10031002
image_id = item.id
@@ -1292,9 +1291,8 @@ def _parse_chunk_from_openai(
12921291
image_base64 = event.partial_image_b64
12931292
partial_index = event.partial_image_index
12941293
image_output = Content.from_uri(
1295-
uri=f"data:{(detect_media_type_from_base64(data_str=image_base64) or 'image/png')};base64,{
1296-
image_base64
1297-
}",
1294+
uri=f"data:{detect_media_type_from_base64(data_str=image_base64) or 'image/png'}"
1295+
f";base64,{image_base64}",
12981296
additional_properties={
12991297
"partial_image_index": partial_index,
13001298
"is_partial_image": True,

python/packages/lab/lightning/tests/test_lightning.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
agentlightning = pytest.importorskip("agentlightning")
1111

12-
from agent_framework import AgentExecutor, AgentRunEvent, ChatAgent, WorkflowBuilder
12+
from agent_framework import AgentExecutor, AgentRunEvent, ChatAgent, WorkflowBuilder, Workflow
1313
from agent_framework_lab_lightning import AgentFrameworkTracer
1414
from agent_framework.openai import OpenAIChatClient
1515
from agentlightning import TracerTraceToTriplet
@@ -106,7 +106,7 @@ def workflow_two_agents():
106106
yield workflow
107107

108108

109-
async def test_openai_workflow_two_agents(workflow_two_agents):
109+
async def test_openai_workflow_two_agents(workflow_two_agents: Workflow):
110110
events = await workflow_two_agents.run("Please analyze the quarterly sales data")
111111

112112
# Get all AgentRunEvent data
@@ -121,7 +121,7 @@ async def test_openai_workflow_two_agents(workflow_two_agents):
121121
)
122122

123123

124-
async def test_observability(workflow_two_agents):
124+
async def test_observability(workflow_two_agents: Workflow):
125125
r"""Expected trace tree:
126126
127127
[workflow.run]

0 commit comments

Comments
 (0)