From ccb6a44e3f18da49d8f4322e0bede32d42ddf6b7 Mon Sep 17 00:00:00 2001 From: Jacob Lee Date: Fri, 10 Nov 2023 02:39:56 -0800 Subject: [PATCH] Update cookbook (#3220) --- cookbook/openai_vision_multimodal.ipynb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/cookbook/openai_vision_multimodal.ipynb b/cookbook/openai_vision_multimodal.ipynb index 5b3170612657..b38df91b38d4 100644 --- a/cookbook/openai_vision_multimodal.ipynb +++ b/cookbook/openai_vision_multimodal.ipynb @@ -22,13 +22,13 @@ "AIMessage {\n", " lc_serializable: \u001b[33mtrue\u001b[39m,\n", " lc_kwargs: {\n", - " content: \u001b[32m'The image features the word \"LangChain\" in black lettering. To the left of the text, there is a grap'\u001b[39m... 109 more characters,\n", - " additional_kwargs: { function_call: \u001b[90mundefined\u001b[39m }\n", + " content: \u001b[32m'The image says \"LangChain\". It includes a graphic of a parrot on the left, two interlinked rings (or'\u001b[39m... 105 more characters,\n", + " additional_kwargs: { function_call: \u001b[90mundefined\u001b[39m, tool_calls: \u001b[90mundefined\u001b[39m }\n", " },\n", " lc_namespace: [ \u001b[32m\"langchain\"\u001b[39m, \u001b[32m\"schema\"\u001b[39m ],\n", - " content: \u001b[32m'The image features the word \"LangChain\" in black lettering. To the left of the text, there is a grap'\u001b[39m... 109 more characters,\n", + " content: \u001b[32m'The image says \"LangChain\". It includes a graphic of a parrot on the left, two interlinked rings (or'\u001b[39m... 105 more characters,\n", " name: \u001b[90mundefined\u001b[39m,\n", - " additional_kwargs: { function_call: \u001b[90mundefined\u001b[39m }\n", + " additional_kwargs: { function_call: \u001b[90mundefined\u001b[39m, tool_calls: \u001b[90mundefined\u001b[39m }\n", "}" ] }, @@ -38,10 +38,10 @@ } ], "source": [ - "Deno.env.set(\"OPENAI_API_KEY\", \"\");\n", + "// Deno.env.set(\"OPENAI_API_KEY\", \"\");\n", "\n", - "import { ChatOpenAI } from \"npm:langchain@0.0.182-rc.0/chat_models/openai\";\n", - "import { HumanMessage } from \"npm:langchain@0.0.182-rc.0/schema\";\n", + "import { ChatOpenAI } from \"npm:langchain@0.0.185/chat_models/openai\";\n", + "import { HumanMessage } from \"npm:langchain@0.0.185/schema\";\n", "\n", "const chat = new ChatOpenAI({\n", " modelName: \"gpt-4-vision-preview\",\n", @@ -81,7 +81,7 @@ { "data": { "text/plain": [ - "\u001b[32m`Avast, ye be lookin' at words that spell out \"LangChain,\" with a colorful parrot on the port side an`\u001b[39m... 57 more characters" + "\u001b[32m`Arrr, matey! The image be showin' the text \"LangChain,\" with a colorful parrot on the port side and `\u001b[39m... 52 more characters" ] }, "execution_count": 2, @@ -90,8 +90,8 @@ } ], "source": [ - "import { ChatPromptTemplate, MessagesPlaceholder } from \"npm:langchain@0.0.182-rc.0/prompts\";\n", - "import { StringOutputParser } from \"npm:langchain@0.0.182-rc.0/schema/output_parser\";\n", + "import { ChatPromptTemplate, MessagesPlaceholder } from \"npm:langchain@0.0.185/prompts\";\n", + "import { StringOutputParser } from \"npm:langchain@0.0.185/schema/output_parser\";\n", "\n", "const prompt = ChatPromptTemplate.fromMessages([\n", " [\"system\", \"Answer all questions like a pirate.\"],\n", @@ -122,7 +122,7 @@ { "data": { "text/plain": [ - "\u001b[32m\"Arrr! That be a fine image of a hot dog ye have there! A grilled sausage nestled betwixt halves of a\"\u001b[39m... 84 more characters" + "\u001b[32m\"Arrr, matey! What ye be starin' at is a fine image of a hot dog, perched in a soft bun, ready to be \"\u001b[39m... 182 more characters" ] }, "execution_count": 3,