diff --git a/setup.py b/setup.py index 2ed2644270..649baae863 100644 --- a/setup.py +++ b/setup.py @@ -59,8 +59,6 @@ "ipykernel>=6.29.0", ] -types = ["mypy==1.9.0"] + test + jupyter_executor - retrieve_chat = [ "protobuf==4.25.3", "chromadb==0.5.3", @@ -87,7 +85,7 @@ interop_pydantic_ai = ["pydantic-ai>=0.0.13,<1; python_version>='3.9'"] interop = interop_crewai + interop_langchain + interop_pydantic_ai -types = ["mypy==1.9.0", "pytest"] + jupyter_executor + interop +types = ["mypy==1.9.0"] + test + jupyter_executor + interop if current_os in ["Windows", "Darwin"]: retrieve_chat_pgvector.extend(["psycopg[binary]>=3.1.18"]) diff --git a/test/interop/langchain/test_langchain.py b/test/interop/langchain/test_langchain.py index cbd038d8a5..be0a2f6bfc 100644 --- a/test/interop/langchain/test_langchain.py +++ b/test/interop/langchain/test_langchain.py @@ -50,7 +50,7 @@ def test_convert_tool(self) -> None: assert self.tool.name == "search-tool" assert self.tool.description == "Look up things online." - tool_input = self.model_type(query="LangChain") + tool_input = self.model_type(query="LangChain") # type: ignore[misc] assert self.tool.func(tool_input=tool_input) == "LangChain Integration" @pytest.mark.skipif(skip_openai, reason=reason) @@ -101,7 +101,7 @@ def test_convert_tool(self) -> None: assert self.tool.name == "search" assert self.tool.description == "Look up things online." - tool_input = self.model_type(query="LangChain", max_length=100) + tool_input = self.model_type(query="LangChain", max_length=100) # type: ignore[misc] assert self.tool.func(tool_input=tool_input) == "LangChain Integration, max_length: 100" @pytest.mark.skipif(skip_openai, reason=reason) diff --git a/test/interop/pydantic_ai/test_pydantic_ai.py b/test/interop/pydantic_ai/test_pydantic_ai.py index 4f0a2da458..2840cdbc9a 100644 --- a/test/interop/pydantic_ai/test_pydantic_ai.py +++ b/test/interop/pydantic_ai/test_pydantic_ai.py @@ -38,7 +38,7 @@ def roll_dice() -> str: """Roll a six-sided dice and return the result.""" return str(random.randint(1, 6)) - pydantic_ai_tool = PydanticAITool(roll_dice, max_retries=3) + pydantic_ai_tool = PydanticAITool(roll_dice, max_retries=3) # type: ignore[var-annotated] self.tool = PydanticAIInteroperability.convert_tool(pydantic_ai_tool) def test_type_checks(self) -> None: @@ -95,10 +95,10 @@ def f( ctx = RunContext( deps=123, retry=0, - messages=None, + messages=None, # type: ignore[arg-type] tool_name=f.__name__, ) - pydantic_ai_tool = PydanticAITool(f, takes_ctx=True) + pydantic_ai_tool = PydanticAITool(f, takes_ctx=True) # type: ignore[var-annotated] g = PydanticAIInteroperability.inject_params( ctx=ctx, tool=pydantic_ai_tool, @@ -119,11 +119,11 @@ def f( ctx = RunContext( deps=123, retry=0, - messages=None, + messages=None, # type: ignore[arg-type] tool_name=f.__name__, ) - pydantic_ai_tool = PydanticAITool(f, takes_ctx=True, max_retries=3) + pydantic_ai_tool = PydanticAITool(f, takes_ctx=True, max_retries=3) # type: ignore[var-annotated] g = PydanticAIInteroperability.inject_params( ctx=ctx, tool=pydantic_ai_tool, @@ -158,7 +158,7 @@ def get_player(ctx: RunContext[Player], additional_info: Optional[str] = None) - """ return f"Name: {ctx.deps.name}, Age: {ctx.deps.age}, Additional info: {additional_info}" # type: ignore[attr-defined] - self.pydantic_ai_tool = PydanticAITool(get_player, takes_ctx=True) + self.pydantic_ai_tool = PydanticAITool(get_player, takes_ctx=True) # type: ignore[var-annotated] player = Player(name="Luka", age=25) self.tool = PydanticAIInteroperability.convert_tool(tool=self.pydantic_ai_tool, deps=player) diff --git a/test/interop/pydantic_ai/test_pydantic_ai_tool.py b/test/interop/pydantic_ai/test_pydantic_ai_tool.py index f5588ad8b6..f1ae38389e 100644 --- a/test/interop/pydantic_ai/test_pydantic_ai_tool.py +++ b/test/interop/pydantic_ai/test_pydantic_ai_tool.py @@ -34,7 +34,7 @@ def foobar(a: int, b: str, c: dict[str, list[float]]) -> str: # type: ignore[mi """ return f"{a} {b} {c}" - tool = PydanticAITool(foobar) + tool = PydanticAITool(foobar) # type: ignore[var-annotated] ag2_tool = AG2PydanticAITool( name=tool.name, description=tool.description,