Skip to content

Commit

Permalink
Merge pull request #15 from langchain-ai/move_from_preview
Browse files Browse the repository at this point in the history
Move VertexAI from preview and bump the SDK version
  • Loading branch information
lkuligin authored Feb 19, 2024
2 parents 7938fe3 + 484e908 commit 6087290
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 29 deletions.
2 changes: 1 addition & 1 deletion libs/vertexai/langchain_google_vertexai/_enums.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from vertexai.preview.generative_models import ( # type: ignore
from vertexai.generative_models import ( # type: ignore
HarmBlockThreshold,
HarmCategory,
)
Expand Down
14 changes: 7 additions & 7 deletions libs/vertexai/langchain_google_vertexai/chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@
)
from langchain_core.outputs import ChatGeneration, ChatGenerationChunk, ChatResult
from langchain_core.pydantic_v1 import root_validator
from vertexai.generative_models import ( # type: ignore
Candidate,
Content,
GenerativeModel,
Image,
Part,
)
from vertexai.language_models import ( # type: ignore
ChatMessage,
ChatModel,
Expand All @@ -39,13 +46,6 @@
CodeChatSession,
InputOutputTextPair,
)
from vertexai.preview.generative_models import ( # type: ignore
Candidate,
Content,
GenerativeModel,
Image,
Part,
)
from vertexai.preview.language_models import ( # type: ignore
ChatModel as PreviewChatModel,
)
Expand Down
6 changes: 4 additions & 2 deletions libs/vertexai/langchain_google_vertexai/functions_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
from langchain_core.tools import BaseTool
from langchain_core.utils.function_calling import FunctionDescription
from langchain_core.utils.json_schema import dereference_refs
from vertexai.preview.generative_models import ( # type: ignore
from vertexai.generative_models import ( # type: ignore
FunctionDeclaration,
)
from vertexai.preview.generative_models import Tool as VertexTool
from vertexai.generative_models import (
Tool as VertexTool,
)


def _format_pydantic_to_vertex_function(
Expand Down
8 changes: 4 additions & 4 deletions libs/vertexai/langchain_google_vertexai/llms.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
from langchain_core.language_models.llms import BaseLLM
from langchain_core.outputs import Generation, GenerationChunk, LLMResult
from langchain_core.pydantic_v1 import BaseModel, Field, root_validator
from vertexai.generative_models import ( # type: ignore[import-untyped]
GenerativeModel,
Image,
)
from vertexai.language_models import ( # type: ignore[import-untyped]
CodeGenerationModel,
TextGenerationModel,
)
from vertexai.language_models._language_models import ( # type: ignore[import-untyped]
TextGenerationResponse,
)
from vertexai.preview.generative_models import ( # type: ignore[import-untyped]
GenerativeModel,
Image,
)
from vertexai.preview.language_models import ( # type: ignore[import-untyped]
ChatModel as PreviewChatModel,
)
Expand Down
21 changes: 10 additions & 11 deletions libs/vertexai/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions libs/vertexai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ license = "MIT"

[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
langchain-core = ">=0.1.7,<0.2"
google-cloud-aiplatform = "^1.39.0"
langchain-core = ">=0.1.23,<0.2"
google-cloud-aiplatform = "^1.42.1"
google-cloud-storage = "^2.14.0"
types-requests = "^2.31.0"
types-protobuf = "^4.24.0.4"
Expand Down
4 changes: 2 additions & 2 deletions libs/vertexai/tests/unit_tests/test_chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
HumanMessage,
SystemMessage,
)
from vertexai.language_models import ChatMessage, InputOutputTextPair # type: ignore
from vertexai.preview.generative_models import ( # type: ignore
from vertexai.generative_models import ( # type: ignore
Candidate,
)
from vertexai.language_models import ChatMessage, InputOutputTextPair # type: ignore

from langchain_google_vertexai.chat_models import (
ChatVertexAI,
Expand Down

0 comments on commit 6087290

Please sign in to comment.