Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
lkuligin committed Apr 11, 2024
1 parent d2bd4fa commit cf84c17
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions libs/vertexai/langchain_google_vertexai/chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ def _stream(
self._is_gemini_model,
usage_metadata=response.to_dict().get("usage_metadata"),
)
if run_manager:
if run_manager and isinstance(message.content, str):
run_manager.on_llm_new_token(message.content)
if isinstance(message, AIMessageChunk):
yield ChatGenerationChunk(
Expand Down Expand Up @@ -744,7 +744,7 @@ async def _astream(
self._is_gemini_model,
usage_metadata=chunk.to_dict().get("usage_metadata"),
)
if run_manager:
if run_manager and isinstance(message.content, str):
await run_manager.on_llm_new_token(message.content)
if isinstance(message, AIMessageChunk):
yield ChatGenerationChunk(
Expand Down
1 change: 0 additions & 1 deletion libs/vertexai/tests/unit_tests/test_chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ def test_default_params_gemini() -> None:
assert mock_generate_content.call_args.args[0][0].parts[0].text == user_prompt



@pytest.mark.parametrize(
"raw_candidate, expected",
[
Expand Down
5 changes: 3 additions & 2 deletions libs/vertexai/tests/unit_tests/test_function_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

from langchain_core.pydantic_v1 import BaseModel, Field
from langchain_core.tools import tool
from vertexai.generative_models._generative_models import ToolConfig
from vertexai.generative_models._generative_models import ( # type: ignore[import-untyped]
ToolConfig,
)

from langchain_google_vertexai.functions_utils import (
_format_tool_config,
Expand Down Expand Up @@ -69,7 +71,6 @@ def test_format_tool_config():
assert isinstance(tool_config, ToolConfig)



def test_get_parameters_from_schema():
class StringEnum(str, Enum):
pear = "pear"
Expand Down

0 comments on commit cf84c17

Please sign in to comment.