Skip to content

Commit

Permalink
Add test_gemini_with_tools_parameters_set_to_is_annotated_with_none_a…
Browse files Browse the repository at this point in the history
…s_default_value and mark it with skip until the issue is resolved
  • Loading branch information
rjambrecic committed Jan 22, 2025
1 parent ec1eb3e commit 634e583
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
28 changes: 27 additions & 1 deletion test/agentchat/test_conversable_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import os
import time
import unittest
from typing import Annotated, Any, Callable, Literal
from typing import Annotated, Any, Callable, Literal, Optional
from unittest.mock import MagicMock

import pytest
Expand Down Expand Up @@ -1543,6 +1543,32 @@ def test_context_variables():
assert agent._context_variables == expected_final_context


@pytest.mark.skip(reason="This test is failing. We need to investigate the issue.")
@pytest.mark.gemini
def test_gemini_with_tools_parameters_set_to_is_annotated_with_none_as_default_value(
credentials_gemini_pro: Credentials,
) -> None:
agent = ConversableAgent(name="agent", llm_config=credentials_gemini_pro.llm_config)

user_proxy = UserProxyAgent(
name="user_proxy_1",
human_input_mode="NEVER",
)

mock = MagicMock()

@user_proxy.register_for_execution()
@agent.register_for_llm(description="Login function")
def login(
additional_notes: Annotated[Optional[str], "Additional notes"] = None,
) -> str:
return "Login successful."

user_proxy.initiate_chat(agent, message="Please login", max_turns=2)

mock.assert_called_once()


if __name__ == "__main__":
# test_trigger()
# test_context()
Expand Down
26 changes: 0 additions & 26 deletions test/agentchat/test_dependancy_injection.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,29 +262,3 @@ async def test_end2end(
is_async: bool,
) -> None:
await self._test_end2end(credentials_from_test_param, is_async)

@pytest.mark.skip(reason="This test is failing. We need to investigate the issue.")
@pytest.mark.gemini
def test_gemini_with_tools_parameters_set_to_is_annotated_with_none_as_default_value(
self,
credentials_gemini_pro: Credentials,
) -> None:
agent = ConversableAgent(name="agent", llm_config=credentials_gemini_pro.llm_config)

user_proxy = UserProxyAgent(
name="user_proxy_1",
human_input_mode="NEVER",
)

mock = MagicMock()

@user_proxy.register_for_execution()
@agent.register_for_llm(description="Login function")
def login(
additional_notes: Annotated[Optional[str], "Additional notes"] = None,
) -> str:
return "Login successful."

user_proxy.initiate_chat(agent, message="Please login", max_turns=2)

mock.assert_called_once()

0 comments on commit 634e583

Please sign in to comment.