Skip to content

Commit 1a3a20d

Browse files
committed
how about this
1 parent b83d69b commit 1a3a20d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/agentex/lib/testing/sessions/sync.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ def send_message_streaming(self, content: str):
147147
first_chunk = next(response_generator, None)
148148
if first_chunk and hasattr(first_chunk, 'result'):
149149
result = first_chunk.result
150-
if hasattr(result, 'task_id') and getattr(result, 'task_id'):
151-
self.task_id = getattr(result, 'task_id')
150+
if hasattr(result, 'task_id') and result.task_id: # type: ignore
151+
self.task_id = result.task_id # type: ignore
152152
logger.debug(f"Task auto-created from stream: {self.task_id}")
153153
# Check if result has parent_task_message with task_id
154154
elif hasattr(result, 'parent_task_message') and result.parent_task_message:

src/agentex/lib/testing/type_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ def extract_agent_response(response, agent_id: str): # type: ignore[no-untyped-
6464

6565
# SendMessageResponse: result.content
6666
if hasattr(result, "content"):
67-
content = getattr(result, "content")
67+
content = result.content # type: ignore
6868
if isinstance(content, TextContent):
6969
return content
7070

7171
# SendEventResponse: result.message.content
72-
if hasattr(result, "message") and getattr(result, "message"):
73-
message = getattr(result, "message")
72+
if hasattr(result, "message") and result.message: # type: ignore
73+
message = result.message # type: ignore
7474
if hasattr(message, "content"):
75-
content = getattr(message, "content")
75+
content = message.content
7676
if isinstance(content, TextContent):
7777
return content
7878

0 commit comments

Comments
 (0)