Skip to content

Commit

Permalink
refactoring and test fix
Browse files Browse the repository at this point in the history
Signed-off-by: Davor Runje <[email protected]>
  • Loading branch information
davorrunje committed Dec 17, 2024
1 parent 1b55bd7 commit c9722b3
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 9 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ files = [
"autogen/function_utils.py",
"autogen/io",
"autogen/tools",
"autogen/interoperability",
"autogen/interop",
"test/test_pydantic.py",
"test/test_function_utils.py",
"test/io",
"test/tools",
"test/interoperability",
"test/interop",
]
exclude = [
"autogen/math_utils\\.py",
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
FileReadTool = unittest.mock.MagicMock()

from autogen import AssistantAgent, UserProxyAgent
from autogen.interoperability import Interoperable
from autogen.interop import Interoperable

if sys.version_info >= (3, 10) and sys.version_info < (3, 13):
from autogen.interoperability.crewai import CrewAIInteroperability
from autogen.interop.crewai import CrewAIInteroperability
else:
CrewAIInteroperability = unittest.mock.MagicMock()

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@

import pytest
from conftest import reason, skip_openai
from langchain.tools import tool
from pydantic import BaseModel, Field

from autogen import AssistantAgent, UserProxyAgent
from autogen.interoperability import Interoperable
from autogen.interop import Interoperable

if sys.version_info >= (3, 9):
from autogen.interoperability.langchain import LangchainInteroperability
from langchain.tools import tool

from autogen.interop.langchain import LangchainInteroperability
else:
tool = unittest.mock.MagicMock()
LangchainInteroperability = unittest.mock.MagicMock()


Expand Down Expand Up @@ -88,7 +90,7 @@ def test_with_llm(self) -> None:
class TestLangchainInteroperabilityWithoutPydanticInput:
@pytest.fixture(autouse=True)
def setup(self) -> None:
@tool # type: ignore[misc]
@tool
def search(query: str, max_length: int) -> str:
"""Look up things online."""
return f"LangChain Integration, max_length: {max_length}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: Apache-2.0

from autogen.interoperability import Interoperable
from autogen.interop import Interoperable


def test_interoperable() -> None:
Expand Down

0 comments on commit c9722b3

Please sign in to comment.