mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Fix mypy
This commit is contained in:
@@ -727,8 +727,8 @@ class WorkflowAgent(BaseAgent):
|
||||
for message in input_messages:
|
||||
for content in message.contents:
|
||||
if content.type == "function_approval_response":
|
||||
request_id: str = content.id # pyright: ignore[reportAssignmentType]
|
||||
function_call: Content = content.function_call # type: ignore[attr-defined]
|
||||
request_id: str = content.id # type: ignore[assignment]
|
||||
function_call: Content = content.function_call # type: ignore[assignment]
|
||||
# Parse the function arguments to recover request payload
|
||||
if function_call.name != self.REQUEST_INFO_FUNCTION_NAME:
|
||||
# This response is for a raw approval request that is itself already an
|
||||
@@ -753,7 +753,7 @@ class WorkflowAgent(BaseAgent):
|
||||
function_responses[request_id] = parsed_args.data
|
||||
elif content.type == "function_result":
|
||||
response_data = content.result if hasattr(content, "result") else str(content) # type: ignore[attr-defined]
|
||||
function_responses[content.call_id] = response_data # pyright: ignore[reportArgumentType]
|
||||
function_responses[content.call_id] = response_data # type: ignore[argument-type]
|
||||
else:
|
||||
raise AgentInvalidResponseException(
|
||||
"Unexpected content type while awaiting request info responses."
|
||||
|
||||
@@ -436,7 +436,7 @@ class AgentExecutor(Executor):
|
||||
total_message_content_count = sum(len(msg.contents) for msg in response.messages)
|
||||
if user_input_request_count != total_message_content_count:
|
||||
logger.warning(
|
||||
"Response %d contains %d user input requests but total message contents are %d. "
|
||||
"Response %s contains %d user input requests but total message contents are %d. "
|
||||
"This indicates the response contains both user input requests and message contents. "
|
||||
"Double check if this is the intended behavior, as non user input request contents in "
|
||||
"this response will not be emitted.",
|
||||
@@ -492,7 +492,7 @@ class AgentExecutor(Executor):
|
||||
total_message_content_count = len(update.contents)
|
||||
if user_input_request_count != total_message_content_count:
|
||||
logger.warning(
|
||||
"Response update %d contains %d user input requests but total message contents are %d. "
|
||||
"Response update %s contains %d user input requests but total message contents are %d. "
|
||||
"This indicates the response update contains both user input requests and message contents. "
|
||||
"Double check if this is the intended behavior, as non user input request contents will "
|
||||
"not be emitted.",
|
||||
|
||||
Reference in New Issue
Block a user