diff --git a/cookbook/Multi_modal_RAG_google.ipynb b/cookbook/Multi_modal_RAG_google.ipynb index 55a53d5ea0..de4489afdd 100644 --- a/cookbook/Multi_modal_RAG_google.ipynb +++ b/cookbook/Multi_modal_RAG_google.ipynb @@ -185,7 +185,7 @@ " )\n", " # Text summary chain\n", " model = VertexAI(\n", - " temperature=0, model_name=\"gemini-pro\", max_output_tokens=1024\n", + " temperature=0, model_name=\"gemini-pro\", max_tokens=1024\n", " ).with_fallbacks([empty_response])\n", " summarize_chain = {\"element\": lambda x: x} | prompt | model | StrOutputParser()\n", "\n", @@ -254,7 +254,7 @@ "\n", "def image_summarize(img_base64, prompt):\n", " \"\"\"Make image summary\"\"\"\n", - " model = ChatVertexAI(model_name=\"gemini-pro-vision\", max_output_tokens=1024)\n", + " model = ChatVertexAI(model=\"gemini-pro-vision\", max_tokens=1024)\n", "\n", " msg = model.invoke(\n", " [\n", @@ -553,9 +553,7 @@ " \"\"\"\n", "\n", " # Multi-modal LLM\n", - " model = ChatVertexAI(\n", - " temperature=0, model_name=\"gemini-pro-vision\", max_output_tokens=1024\n", - " )\n", + " model = ChatVertexAI(temperature=0, model_name=\"gemini-pro-vision\", max_tokens=1024)\n", "\n", " # RAG pipeline\n", " chain = (\n", diff --git a/docs/docs/integrations/chat/google_vertex_ai_palm.ipynb b/docs/docs/integrations/chat/google_vertex_ai_palm.ipynb index 6f44b09459..168d27dd4a 100644 --- a/docs/docs/integrations/chat/google_vertex_ai_palm.ipynb +++ b/docs/docs/integrations/chat/google_vertex_ai_palm.ipynb @@ -114,7 +114,7 @@ "human = \"Translate this sentence from English to French. I love programming.\"\n", "prompt = ChatPromptTemplate.from_messages([(\"system\", system), (\"human\", human)])\n", "\n", - "chat = ChatVertexAI(model_name=\"gemini-pro\", convert_system_message_to_human=True)\n", + "chat = ChatVertexAI(model=\"gemini-pro\", convert_system_message_to_human=True)\n", "\n", "chain = prompt | chat\n", "chain.invoke({})" @@ -233,9 +233,7 @@ } ], "source": [ - "chat = ChatVertexAI(\n", - " model_name=\"codechat-bison\", max_output_tokens=1000, temperature=0.5\n", - ")\n", + "chat = ChatVertexAI(model=\"codechat-bison\", max_tokens=1000, temperature=0.5)\n", "\n", "message = chat.invoke(\"Write a Python function generating all prime numbers\")\n", "print(message.content)" @@ -399,7 +397,7 @@ " location: str = Field(..., description=\"The city and state, e.g. San Francisco, CA\")\n", "\n", "\n", - "llm = ChatVertexAI(model_name=\"gemini-pro\", temperature=0)\n", + "llm = ChatVertexAI(model=\"gemini-pro\", temperature=0)\n", "llm_with_tools = llm.bind_tools([GetWeather])\n", "ai_msg = llm_with_tools.invoke(\n", " \"what is the weather like in San Francisco\",\n", @@ -551,7 +549,7 @@ "human = \"{text}\"\n", "prompt = ChatPromptTemplate.from_messages([(\"system\", system), (\"human\", human)])\n", "\n", - "chat = ChatVertexAI(model_name=\"chat-bison\", max_output_tokens=1000, temperature=0.5)\n", + "chat = ChatVertexAI(model=\"chat-bison\", max_tokens=1000, temperature=0.5)\n", "chain = prompt | chat\n", "\n", "asyncio.run(\n", diff --git a/docs/docs/integrations/llms/google_vertex_ai_palm.ipynb b/docs/docs/integrations/llms/google_vertex_ai_palm.ipynb index b608d556cc..dc0ae0a50f 100644 --- a/docs/docs/integrations/llms/google_vertex_ai_palm.ipynb +++ b/docs/docs/integrations/llms/google_vertex_ai_palm.ipynb @@ -403,7 +403,7 @@ } ], "source": [ - "llm = VertexAI(model_name=\"code-bison\", max_output_tokens=1000, temperature=0.3)\n", + "llm = VertexAI(model_name=\"code-bison\", max_tokens=1000, temperature=0.3)\n", "question = \"Write a python function that checks if a string is a valid email address\"\n", "print(model.invoke(question))" ] @@ -439,7 +439,7 @@ "from langchain_core.messages import HumanMessage\n", "from langchain_google_vertexai import ChatVertexAI\n", "\n", - "llm = ChatVertexAI(model_name=\"gemini-pro-vision\")\n", + "llm = ChatVertexAI(model=\"gemini-pro-vision\")\n", "\n", "image_message = {\n", " \"type\": \"image_url\",\n",