Skip to content

Commit ad6cdde

Browse files
committed
fix itk tests
1 parent e7a1c50 commit ad6cdde

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

itk/main.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,19 @@ async def handle_call_agent(call: instruction_pb2.CallAgent) -> list[str]:
138138
nested_msg = wrap_instruction_to_request(call.instruction)
139139
request = SendMessageRequest(message=nested_msg)
140140

141-
results = []
141+
results: list[str] = []
142142
async for event in client.send_message(request):
143-
# Event is streaming response and task
143+
# Event is StreamResponse
144144
logger.info('Event: %s', event)
145-
stream_resp, task = event
145+
stream_resp = event
146146

147147
message = None
148148
if stream_resp.HasField('message'):
149149
message = stream_resp.message
150-
elif task and task.status.HasField('message'):
151-
message = task.status.message
150+
elif stream_resp.HasField(
151+
'task'
152+
) and stream_resp.task.status.HasField('message'):
153+
message = stream_resp.task.status.message
152154
elif stream_resp.HasField(
153155
'status_update'
154156
) and stream_resp.status_update.status.HasField('message'):

0 commit comments

Comments
 (0)