Skip to content

Commit

Permalink
fixed async streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
lkuligin committed Apr 12, 2024
1 parent daec64d commit fd58e07
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions libs/vertexai/langchain_google_vertexai/chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def _convert_to_parts(message: BaseMessage) -> List[Part]:
raw_content = [raw_content]
return [_convert_to_prompt(part) for part in raw_content]

vertex_messages = []
vertex_messages: List[Content] = []
convert_system_message_to_human_content = None
system_instruction = None
for i, message in enumerate(history):
Expand Down Expand Up @@ -733,7 +733,6 @@ async def _astream(
project=self.project,
convert_system_message_to_human=self.convert_system_message_to_human,
)
message = history_gemini.pop()
self.client = _get_client_with_sys_instruction(
client=self.client,
system_instruction=system_instruction,
Expand Down
2 changes: 1 addition & 1 deletion libs/vertexai/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
name = "langchain-google-vertexai"

version = "0.1.3"
version = "1.0.1"
description = "An integration package connecting Google VertexAI and LangChain"
authors = []
readme = "README.md"
Expand Down
2 changes: 0 additions & 2 deletions libs/vertexai/tests/integration_tests/test_chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ def test_vertexai_stream(model_name: str) -> None:
assert isinstance(chunk, AIMessageChunk)


@pytest.mark.xfail
@pytest.mark.release
async def test_vertexai_astream() -> None:
model = ChatVertexAI(temperature=0, model_name="gemini-pro")
Expand Down Expand Up @@ -144,7 +143,6 @@ def test_multimodal() -> None:


@pytest.mark.release
@pytest.mark.xfail(reason="problem on vertex side")
def test_multimodal_history() -> None:
llm = ChatVertexAI(model_name="gemini-pro-vision")
gcs_url = (
Expand Down

0 comments on commit fd58e07

Please sign in to comment.