Skip to content

Commit

Permalink
last try on fixing mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
shankar-vision-eng committed May 23, 2024
1 parent a6da425 commit 6dc5c68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion vision_agent/agent/vision_agent_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def build_working_memory(working_memory: Mapping[str, List[str]]) -> Sim:
for key, value in working_memory.items():
data["desc"].append(key)
data["doc"].append("\n".join(value))
df = pd.DataFrame(data)
df = pd.DataFrame(data) # type: ignore
return Sim(df, sim_key="desc")


Expand Down
7 changes: 4 additions & 3 deletions vision_agent/agent/vision_agent_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging
import sys
from pathlib import Path
from typing import Any, Dict, List, Optional, Union, cast, Callable
from typing import Any, Dict, List, Optional, Union, cast, Callable, no_type_check

from rich.console import Console
from rich.syntax import Syntax
Expand Down Expand Up @@ -273,16 +273,17 @@ def __init__(
self.max_retries = 2
self.report_progress_callback = report_progress_callback

@no_type_check
def __call__(
self,
input: Union[List[Dict[str, str]], str],
image: Optional[Union[str, Path]] = None,
) -> Dict[str, Any]: # type: ignore
) -> Dict[str, Any]:
if isinstance(input, str):
input = [{"role": "user", "content": input}]
results = self.chat_with_workflow(input, image)
results.pop("working_memory")
return results # type: ignore
return results

def chat_with_workflow(
self,
Expand Down

0 comments on commit 6dc5c68

Please sign in to comment.