Skip to content

Commit 81cb755

Browse files
committed
Annotate run_kwargs as Dict[str, Any] so Pyre accepts the imgs list
Pyre inferred Dict[str, str] from the task entry alone, so assigning the imgs list tripped 'Incompatible parameter type [6]' in code scanning.
1 parent 62119eb commit 81cb755

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

swarms/structs/sequential_workflow.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import json
33
import os
44
from concurrent.futures import as_completed
5-
from typing import Callable, List, Optional, Union
5+
from typing import Any, Callable, Dict, List, Optional, Union
66

77
from loguru import logger as loguru_logger
88
from swarms.prompts.multi_agent_collab_prompt import (
@@ -326,7 +326,9 @@ def run(
326326
"""
327327
try:
328328
# prompt = f"{MULTI_AGENT_COLLAB_PROMPT}\n\n{task}"
329-
run_kwargs = {"task": task}
329+
# Annotated because imgs is a list: without it the dict is
330+
# inferred as Dict[str, str] from the task entry alone.
331+
run_kwargs: Dict[str, Any] = {"task": task}
330332
if img is not None:
331333
run_kwargs["img"] = img
332334
if imgs is not None:

0 commit comments

Comments
 (0)