File tree Expand file tree Collapse file tree 4 files changed +21
-3
lines changed
langchain_google_vertexai Expand file tree Collapse file tree 4 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 33from langchain_google_vertexai .chat_models import ChatVertexAI
44from langchain_google_vertexai .functions_utils import PydanticFunctionsOutputParser
55from langchain_google_vertexai .gemma import (
6+ GemmaChatLocalHF ,
67 GemmaChatLocalKaggle ,
78 GemmaChatVertexAIModelGarden ,
89 GemmaLocalHF ,
1213from langchain_google_vertexai .llms import VertexAI
1314from langchain_google_vertexai .model_garden import VertexAIModelGarden
1415from langchain_google_vertexai .vectorstores .vectorstores import VectorSearchVectorStore
16+ from langchain_google_vertexai .vision_models import (
17+ VertexAIImageCaptioning ,
18+ VertexAIImageCaptioningChat ,
19+ VertexAIImageEditorChat ,
20+ VertexAIImageGeneratorChat ,
21+ VertexAIVisualQnAChat ,
22+ )
1523
1624__all__ = [
1725 "ChatVertexAI" ,
2937 "PydanticFunctionsOutputParser" ,
3038 "create_structured_runnable" ,
3139 "VectorSearchVectorStore" ,
40+ "VertexAIImageCaptioning" ,
41+ "VertexAIImageCaptioningChat" ,
42+ "VertexAIImageEditorChat" ,
43+ "VertexAIImageGeneratorChat" ,
44+ "VertexAIVisualQnAChat" ,
3245]
Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ def _generate(
197197 """Run the LLM on the given prompt and input."""
198198 params = {"max_length" : self .max_tokens } if self .max_tokens else {}
199199 results = self .client .generate (prompts , ** params )
200- results = results if isinstance (results , str ) else [ results ]
200+ results = [ results ] if isinstance (results , str ) else results
201201 if stop :
202202 results = [enforce_stop_tokens (text , stop ) for text in results ]
203203 return LLMResult (generations = [[Generation (text = result )] for result in results ])
@@ -268,7 +268,7 @@ def _default_params(self) -> Dict[str, Any]:
268268 params = {"max_length" : self .max_tokens }
269269 return {k : v for k , v in params .items () if v is not None }
270270
271- def _run (self , prompt : str , kwargs : Any ) -> str :
271+ def _run (self , prompt : str , ** kwargs : Any ) -> str :
272272 inputs = self .tokenizer (prompt , return_tensors = "pt" )
273273 generate_ids = self .client .generate (inputs .input_ids , ** kwargs )
274274 return self .tokenizer .batch_decode (
Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " langchain-google-vertexai"
3- version = " 0.0.6 "
3+ version = " 0.0.7 "
44description = " An integration package connecting GoogleVertexAI and LangChain"
55authors = []
66readme = " README.md"
Original file line number Diff line number Diff line change 1616 "PydanticFunctionsOutputParser" ,
1717 "create_structured_runnable" ,
1818 "VectorSearchVectorStore" ,
19+ "VertexAIImageCaptioning" ,
20+ "VertexAIImageCaptioningChat" ,
21+ "VertexAIImageEditorChat" ,
22+ "VertexAIImageGeneratorChat" ,
23+ "VertexAIVisualQnAChat" ,
1924]
2025
2126
You can’t perform that action at this time.
0 commit comments