Skip to content

Commit

Permalink
fix setup
Browse files Browse the repository at this point in the history
  • Loading branch information
davorrunje committed Dec 19, 2024
1 parent 391cdbd commit ba01c09
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"])
Expand Down
4 changes: 2 additions & 2 deletions test/interop/langchain/test_langchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions test/interop/pydantic_ai/test_pydantic_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion test/interop/pydantic_ai/test_pydantic_ai_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ba01c09

Please sign in to comment.