diff --git a/docs/docs/how_to/binding.ipynb b/docs/docs/how_to/binding.ipynb index 563fce7d129..0589d33631c 100644 --- a/docs/docs/how_to/binding.ipynb +++ b/docs/docs/how_to/binding.ipynb @@ -183,7 +183,7 @@ { "data": { "text/plain": [ - "AIMessage(content='', additional_kwargs={'tool_calls': [{'id': 'call_z0OU2CytqENVrRTI6T8DkI3u', 'function': {'arguments': '{\"location\": \"San Francisco, CA\", \"unit\": \"celsius\"}', 'name': 'get_current_weather'}, 'type': 'function'}, {'id': 'call_ft96IJBh0cMKkQWrZjNg4bsw', 'function': {'arguments': '{\"location\": \"New York, NY\", \"unit\": \"celsius\"}', 'name': 'get_current_weather'}, 'type': 'function'}, {'id': 'call_tfbtGgCLmuBuWgZLvpPwvUMH', 'function': {'arguments': '{\"location\": \"Los Angeles, CA\", \"unit\": \"celsius\"}', 'name': 'get_current_weather'}, 'type': 'function'}]}, response_metadata={'token_usage': {'completion_tokens': 84, 'prompt_tokens': 85, 'total_tokens': 169}, 'model_name': 'gpt-3.5-turbo-1106', 'system_fingerprint': 'fp_77a673219d', 'finish_reason': 'tool_calls', 'logprobs': None}, id='run-d57ad5fa-b52a-4822-bc3e-74f838697e18-0', tool_calls=[{'name': 'get_current_weather', 'args': {'location': 'San Francisco, CA', 'unit': 'celsius'}, 'id': 'call_z0OU2CytqENVrRTI6T8DkI3u'}, {'name': 'get_current_weather', 'args': {'location': 'New York, NY', 'unit': 'celsius'}, 'id': 'call_ft96IJBh0cMKkQWrZjNg4bsw'}, {'name': 'get_current_weather', 'args': {'location': 'Los Angeles, CA', 'unit': 'celsius'}, 'id': 'call_tfbtGgCLmuBuWgZLvpPwvUMH'}])" + "AIMessage(content='', additional_kwargs={'tool_calls': [{'id': 'call_z0OU2CytqENVrRTI6T8DkI3u', 'function': {'arguments': '{\"location\": \"San Francisco, CA\", \"unit\": \"celsius\"}', 'name': 'get_current_weather'}, 'type': 'function'}, {'id': 'call_ft96IJBh0cMKkQWrZjNg4bsw', 'function': {'arguments': '{\"location\": \"New York, NY\", \"unit\": \"celsius\"}', 'name': 'get_current_weather'}, 'type': 'function'}, {'id': 'call_tfbtGgCLmuBuWgZLvpPwvUMH', 'function': {'arguments': '{\"location\": \"Los Angeles, CA\", \"unit\": \"celsius\"}', 'name': 'get_current_weather'}, 'type': 'function'}]}, response_metadata={'token_usage': {'completion_tokens': 84, 'prompt_tokens': 85, 'total_tokens': 169}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': 'fp_77a673219d', 'finish_reason': 'tool_calls', 'logprobs': None}, id='run-d57ad5fa-b52a-4822-bc3e-74f838697e18-0', tool_calls=[{'name': 'get_current_weather', 'args': {'location': 'San Francisco, CA', 'unit': 'celsius'}, 'id': 'call_z0OU2CytqENVrRTI6T8DkI3u'}, {'name': 'get_current_weather', 'args': {'location': 'New York, NY', 'unit': 'celsius'}, 'id': 'call_ft96IJBh0cMKkQWrZjNg4bsw'}, {'name': 'get_current_weather', 'args': {'location': 'Los Angeles, CA', 'unit': 'celsius'}, 'id': 'call_tfbtGgCLmuBuWgZLvpPwvUMH'}])" ] }, "execution_count": 5, @@ -192,7 +192,7 @@ } ], "source": [ - "model = ChatOpenAI(model=\"gpt-3.5-turbo-1106\").bind(tools=tools)\n", + "model = ChatOpenAI(model=\"gpt-4o-mini\").bind(tools=tools)\n", "model.invoke(\"What's the weather in SF, NYC and LA?\")" ] }, diff --git a/docs/docs/how_to/chat_token_usage_tracking.ipynb b/docs/docs/how_to/chat_token_usage_tracking.ipynb index 1624ecf3713..24b77c38e16 100644 --- a/docs/docs/how_to/chat_token_usage_tracking.ipynb +++ b/docs/docs/how_to/chat_token_usage_tracking.ipynb @@ -71,7 +71,7 @@ "\n", "from langchain_openai import ChatOpenAI\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\")\n", + "llm = ChatOpenAI(model=\"gpt-4o-mini\")\n", "openai_response = llm.invoke(\"hello\")\n", "openai_response.usage_metadata" ] @@ -182,13 +182,13 @@ "content=' you' id='run-adb20c31-60c7-43a2-99b2-d4a53ca5f623'\n", "content=' today' id='run-adb20c31-60c7-43a2-99b2-d4a53ca5f623'\n", "content='?' id='run-adb20c31-60c7-43a2-99b2-d4a53ca5f623'\n", - "content='' response_metadata={'finish_reason': 'stop', 'model_name': 'gpt-3.5-turbo-0125'} id='run-adb20c31-60c7-43a2-99b2-d4a53ca5f623'\n", + "content='' response_metadata={'finish_reason': 'stop', 'model_name': 'gpt-4o-mini'} id='run-adb20c31-60c7-43a2-99b2-d4a53ca5f623'\n", "content='' id='run-adb20c31-60c7-43a2-99b2-d4a53ca5f623' usage_metadata={'input_tokens': 8, 'output_tokens': 9, 'total_tokens': 17}\n" ] } ], "source": [ - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\")\n", + "llm = ChatOpenAI(model=\"gpt-4o-mini\")\n", "\n", "aggregate = None\n", "for chunk in llm.stream(\"hello\", stream_usage=True):\n", @@ -252,7 +252,7 @@ "content=' you' id='run-8e758550-94b0-4cca-a298-57482793c25d'\n", "content=' today' id='run-8e758550-94b0-4cca-a298-57482793c25d'\n", "content='?' id='run-8e758550-94b0-4cca-a298-57482793c25d'\n", - "content='' response_metadata={'finish_reason': 'stop', 'model_name': 'gpt-3.5-turbo-0125'} id='run-8e758550-94b0-4cca-a298-57482793c25d'\n" + "content='' response_metadata={'finish_reason': 'stop', 'model_name': 'gpt-4o-mini'} id='run-8e758550-94b0-4cca-a298-57482793c25d'\n" ] } ], @@ -300,7 +300,7 @@ "\n", "\n", "llm = ChatOpenAI(\n", - " model=\"gpt-3.5-turbo-0125\",\n", + " model=\"gpt-4o-mini\",\n", " stream_usage=True,\n", ")\n", "# Under the hood, .with_structured_output binds tools to the\n", @@ -362,7 +362,7 @@ "from langchain_community.callbacks.manager import get_openai_callback\n", "\n", "llm = ChatOpenAI(\n", - " model=\"gpt-3.5-turbo-0125\",\n", + " model=\"gpt-4o-mini\",\n", " temperature=0,\n", " stream_usage=True,\n", ")\n", diff --git a/docs/docs/how_to/chatbots_memory.ipynb b/docs/docs/how_to/chatbots_memory.ipynb index 02264712627..a321aef825c 100644 --- a/docs/docs/how_to/chatbots_memory.ipynb +++ b/docs/docs/how_to/chatbots_memory.ipynb @@ -77,7 +77,7 @@ "source": [ "from langchain_openai import ChatOpenAI\n", "\n", - "chat = ChatOpenAI(model=\"gpt-3.5-turbo-0125\")" + "chat = ChatOpenAI(model=\"gpt-4o-mini\")" ] }, { @@ -191,7 +191,7 @@ { "data": { "text/plain": [ - "AIMessage(content='You just asked me to translate the sentence \"I love programming\" from English to French.', response_metadata={'token_usage': {'completion_tokens': 18, 'prompt_tokens': 61, 'total_tokens': 79}, 'model_name': 'gpt-3.5-turbo-0125', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-5cbb21c2-9c30-4031-8ea8-bfc497989535-0', usage_metadata={'input_tokens': 61, 'output_tokens': 18, 'total_tokens': 79})" + "AIMessage(content='You just asked me to translate the sentence \"I love programming\" from English to French.', response_metadata={'token_usage': {'completion_tokens': 18, 'prompt_tokens': 61, 'total_tokens': 79}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-5cbb21c2-9c30-4031-8ea8-bfc497989535-0', usage_metadata={'input_tokens': 61, 'output_tokens': 18, 'total_tokens': 79})" ] }, "execution_count": 5, @@ -312,7 +312,7 @@ { "data": { "text/plain": [ - "AIMessage(content='\"J\\'adore la programmation.\"', response_metadata={'token_usage': {'completion_tokens': 9, 'prompt_tokens': 39, 'total_tokens': 48}, 'model_name': 'gpt-3.5-turbo-0125', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-648b0822-b0bb-47a2-8e7d-7d34744be8f2-0', usage_metadata={'input_tokens': 39, 'output_tokens': 9, 'total_tokens': 48})" + "AIMessage(content='\"J\\'adore la programmation.\"', response_metadata={'token_usage': {'completion_tokens': 9, 'prompt_tokens': 39, 'total_tokens': 48}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-648b0822-b0bb-47a2-8e7d-7d34744be8f2-0', usage_metadata={'input_tokens': 39, 'output_tokens': 9, 'total_tokens': 48})" ] }, "execution_count": 8, @@ -342,7 +342,7 @@ { "data": { "text/plain": [ - "AIMessage(content='You asked me to translate the sentence \"I love programming\" from English to French.', response_metadata={'token_usage': {'completion_tokens': 17, 'prompt_tokens': 63, 'total_tokens': 80}, 'model_name': 'gpt-3.5-turbo-0125', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-5950435c-1dc2-43a6-836f-f989fd62c95e-0', usage_metadata={'input_tokens': 63, 'output_tokens': 17, 'total_tokens': 80})" + "AIMessage(content='You asked me to translate the sentence \"I love programming\" from English to French.', response_metadata={'token_usage': {'completion_tokens': 17, 'prompt_tokens': 63, 'total_tokens': 80}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-5950435c-1dc2-43a6-836f-f989fd62c95e-0', usage_metadata={'input_tokens': 63, 'output_tokens': 17, 'total_tokens': 80})" ] }, "execution_count": 9, @@ -421,7 +421,7 @@ { "data": { "text/plain": [ - "AIMessage(content='Your name is Nemo.', response_metadata={'token_usage': {'completion_tokens': 6, 'prompt_tokens': 66, 'total_tokens': 72}, 'model_name': 'gpt-3.5-turbo-0125', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-f8aabef8-631a-4238-a39b-701e881fbe47-0', usage_metadata={'input_tokens': 66, 'output_tokens': 6, 'total_tokens': 72})" + "AIMessage(content='Your name is Nemo.', response_metadata={'token_usage': {'completion_tokens': 6, 'prompt_tokens': 66, 'total_tokens': 72}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-f8aabef8-631a-4238-a39b-701e881fbe47-0', usage_metadata={'input_tokens': 66, 'output_tokens': 6, 'total_tokens': 72})" ] }, "execution_count": 22, @@ -501,7 +501,7 @@ { "data": { "text/plain": [ - "AIMessage(content='P. Sherman is a fictional character from the animated movie \"Finding Nemo\" who lives at 42 Wallaby Way, Sydney.', response_metadata={'token_usage': {'completion_tokens': 27, 'prompt_tokens': 53, 'total_tokens': 80}, 'model_name': 'gpt-3.5-turbo-0125', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-5642ef3a-fdbe-43cf-a575-d1785976a1b9-0', usage_metadata={'input_tokens': 53, 'output_tokens': 27, 'total_tokens': 80})" + "AIMessage(content='P. Sherman is a fictional character from the animated movie \"Finding Nemo\" who lives at 42 Wallaby Way, Sydney.', response_metadata={'token_usage': {'completion_tokens': 27, 'prompt_tokens': 53, 'total_tokens': 80}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-5642ef3a-fdbe-43cf-a575-d1785976a1b9-0', usage_metadata={'input_tokens': 53, 'output_tokens': 27, 'total_tokens': 80})" ] }, "execution_count": 24, @@ -529,9 +529,9 @@ " HumanMessage(content='How are you today?'),\n", " AIMessage(content='Fine thanks!'),\n", " HumanMessage(content=\"What's my name?\"),\n", - " AIMessage(content='Your name is Nemo.', response_metadata={'token_usage': {'completion_tokens': 6, 'prompt_tokens': 66, 'total_tokens': 72}, 'model_name': 'gpt-3.5-turbo-0125', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-f8aabef8-631a-4238-a39b-701e881fbe47-0', usage_metadata={'input_tokens': 66, 'output_tokens': 6, 'total_tokens': 72}),\n", + " AIMessage(content='Your name is Nemo.', response_metadata={'token_usage': {'completion_tokens': 6, 'prompt_tokens': 66, 'total_tokens': 72}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-f8aabef8-631a-4238-a39b-701e881fbe47-0', usage_metadata={'input_tokens': 66, 'output_tokens': 6, 'total_tokens': 72}),\n", " HumanMessage(content='Where does P. Sherman live?'),\n", - " AIMessage(content='P. Sherman is a fictional character from the animated movie \"Finding Nemo\" who lives at 42 Wallaby Way, Sydney.', response_metadata={'token_usage': {'completion_tokens': 27, 'prompt_tokens': 53, 'total_tokens': 80}, 'model_name': 'gpt-3.5-turbo-0125', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-5642ef3a-fdbe-43cf-a575-d1785976a1b9-0', usage_metadata={'input_tokens': 53, 'output_tokens': 27, 'total_tokens': 80})]" + " AIMessage(content='P. Sherman is a fictional character from the animated movie \"Finding Nemo\" who lives at 42 Wallaby Way, Sydney.', response_metadata={'token_usage': {'completion_tokens': 27, 'prompt_tokens': 53, 'total_tokens': 80}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-5642ef3a-fdbe-43cf-a575-d1785976a1b9-0', usage_metadata={'input_tokens': 53, 'output_tokens': 27, 'total_tokens': 80})]" ] }, "execution_count": 25, @@ -565,7 +565,7 @@ { "data": { "text/plain": [ - "AIMessage(content=\"I'm sorry, but I don't have access to your personal information, so I don't know your name. How else may I assist you today?\", response_metadata={'token_usage': {'completion_tokens': 31, 'prompt_tokens': 74, 'total_tokens': 105}, 'model_name': 'gpt-3.5-turbo-0125', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-0ab03495-1f7c-4151-9070-56d2d1c565ff-0', usage_metadata={'input_tokens': 74, 'output_tokens': 31, 'total_tokens': 105})" + "AIMessage(content=\"I'm sorry, but I don't have access to your personal information, so I don't know your name. How else may I assist you today?\", response_metadata={'token_usage': {'completion_tokens': 31, 'prompt_tokens': 74, 'total_tokens': 105}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-0ab03495-1f7c-4151-9070-56d2d1c565ff-0', usage_metadata={'input_tokens': 74, 'output_tokens': 31, 'total_tokens': 105})" ] }, "execution_count": 27, diff --git a/docs/docs/how_to/chatbots_retrieval.ipynb b/docs/docs/how_to/chatbots_retrieval.ipynb index 757dc0cfcac..015e0d34456 100644 --- a/docs/docs/how_to/chatbots_retrieval.ipynb +++ b/docs/docs/how_to/chatbots_retrieval.ipynb @@ -71,7 +71,7 @@ "source": [ "from langchain_openai import ChatOpenAI\n", "\n", - "chat = ChatOpenAI(model=\"gpt-3.5-turbo-1106\", temperature=0.2)" + "chat = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0.2)" ] }, { diff --git a/docs/docs/how_to/chatbots_tools.ipynb b/docs/docs/how_to/chatbots_tools.ipynb index 07fff046b30..95125b15bb0 100644 --- a/docs/docs/how_to/chatbots_tools.ipynb +++ b/docs/docs/how_to/chatbots_tools.ipynb @@ -70,7 +70,7 @@ "\n", "# Choose the LLM that will drive the agent\n", "# Only certain models support this\n", - "chat = ChatOpenAI(model=\"gpt-3.5-turbo-1106\", temperature=0)" + "chat = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)" ] }, { diff --git a/docs/docs/how_to/contextual_compression.ipynb b/docs/docs/how_to/contextual_compression.ipynb index 02dd941fd85..8d58db9cf15 100644 --- a/docs/docs/how_to/contextual_compression.ipynb +++ b/docs/docs/how_to/contextual_compression.ipynb @@ -258,7 +258,7 @@ "from langchain.retrievers.document_compressors import LLMListwiseRerank\n", "from langchain_openai import ChatOpenAI\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0)\n", + "llm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)\n", "\n", "_filter = LLMListwiseRerank.from_llm(llm, top_n=1)\n", "compression_retriever = ContextualCompressionRetriever(\n", diff --git a/docs/docs/how_to/convert_runnable_to_tool.ipynb b/docs/docs/how_to/convert_runnable_to_tool.ipynb index f087f1b5923..d8774194ad7 100644 --- a/docs/docs/how_to/convert_runnable_to_tool.ipynb +++ b/docs/docs/how_to/convert_runnable_to_tool.ipynb @@ -285,7 +285,7 @@ "\n", "from langchain_openai import ChatOpenAI\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0)" + "llm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)" ] }, { @@ -362,11 +362,11 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'agent': {'messages': [AIMessage(content='', additional_kwargs={'tool_calls': [{'id': 'call_W8cnfOjwqEn4cFcg19LN9mYD', 'function': {'arguments': '{\"__arg1\":\"dogs\"}', 'name': 'pet_info_retriever'}, 'type': 'function'}]}, response_metadata={'token_usage': {'completion_tokens': 19, 'prompt_tokens': 60, 'total_tokens': 79}, 'model_name': 'gpt-3.5-turbo-0125', 'system_fingerprint': None, 'finish_reason': 'tool_calls', 'logprobs': None}, id='run-d7f81de9-1fb7-4caf-81ed-16dcdb0b2ab4-0', tool_calls=[{'name': 'pet_info_retriever', 'args': {'__arg1': 'dogs'}, 'id': 'call_W8cnfOjwqEn4cFcg19LN9mYD'}], usage_metadata={'input_tokens': 60, 'output_tokens': 19, 'total_tokens': 79})]}}\n", + "{'agent': {'messages': [AIMessage(content='', additional_kwargs={'tool_calls': [{'id': 'call_W8cnfOjwqEn4cFcg19LN9mYD', 'function': {'arguments': '{\"__arg1\":\"dogs\"}', 'name': 'pet_info_retriever'}, 'type': 'function'}]}, response_metadata={'token_usage': {'completion_tokens': 19, 'prompt_tokens': 60, 'total_tokens': 79}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': None, 'finish_reason': 'tool_calls', 'logprobs': None}, id='run-d7f81de9-1fb7-4caf-81ed-16dcdb0b2ab4-0', tool_calls=[{'name': 'pet_info_retriever', 'args': {'__arg1': 'dogs'}, 'id': 'call_W8cnfOjwqEn4cFcg19LN9mYD'}], usage_metadata={'input_tokens': 60, 'output_tokens': 19, 'total_tokens': 79})]}}\n", "----\n", "{'tools': {'messages': [ToolMessage(content=\"[Document(id='86f835fe-4bbe-4ec6-aeb4-489a8b541707', page_content='Dogs are great companions, known for their loyalty and friendliness.')]\", name='pet_info_retriever', tool_call_id='call_W8cnfOjwqEn4cFcg19LN9mYD')]}}\n", "----\n", - "{'agent': {'messages': [AIMessage(content='Dogs are known for being great companions, known for their loyalty and friendliness.', response_metadata={'token_usage': {'completion_tokens': 18, 'prompt_tokens': 134, 'total_tokens': 152}, 'model_name': 'gpt-3.5-turbo-0125', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-9ca5847a-a5eb-44c0-a774-84cc2c5bbc5b-0', usage_metadata={'input_tokens': 134, 'output_tokens': 18, 'total_tokens': 152})]}}\n", + "{'agent': {'messages': [AIMessage(content='Dogs are known for being great companions, known for their loyalty and friendliness.', response_metadata={'token_usage': {'completion_tokens': 18, 'prompt_tokens': 134, 'total_tokens': 152}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-9ca5847a-a5eb-44c0-a774-84cc2c5bbc5b-0', usage_metadata={'input_tokens': 134, 'output_tokens': 18, 'total_tokens': 152})]}}\n", "----\n" ] } @@ -497,11 +497,11 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'agent': {'messages': [AIMessage(content='', additional_kwargs={'tool_calls': [{'id': 'call_17iLPWvOD23zqwd1QVQ00Y63', 'function': {'arguments': '{\"question\":\"What are dogs known for according to pirates?\",\"answer_style\":\"quote\"}', 'name': 'pet_expert'}, 'type': 'function'}]}, response_metadata={'token_usage': {'completion_tokens': 28, 'prompt_tokens': 59, 'total_tokens': 87}, 'model_name': 'gpt-3.5-turbo-0125', 'system_fingerprint': None, 'finish_reason': 'tool_calls', 'logprobs': None}, id='run-7fef44f3-7bba-4e63-8c51-2ad9c5e65e2e-0', tool_calls=[{'name': 'pet_expert', 'args': {'question': 'What are dogs known for according to pirates?', 'answer_style': 'quote'}, 'id': 'call_17iLPWvOD23zqwd1QVQ00Y63'}], usage_metadata={'input_tokens': 59, 'output_tokens': 28, 'total_tokens': 87})]}}\n", + "{'agent': {'messages': [AIMessage(content='', additional_kwargs={'tool_calls': [{'id': 'call_17iLPWvOD23zqwd1QVQ00Y63', 'function': {'arguments': '{\"question\":\"What are dogs known for according to pirates?\",\"answer_style\":\"quote\"}', 'name': 'pet_expert'}, 'type': 'function'}]}, response_metadata={'token_usage': {'completion_tokens': 28, 'prompt_tokens': 59, 'total_tokens': 87}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': None, 'finish_reason': 'tool_calls', 'logprobs': None}, id='run-7fef44f3-7bba-4e63-8c51-2ad9c5e65e2e-0', tool_calls=[{'name': 'pet_expert', 'args': {'question': 'What are dogs known for according to pirates?', 'answer_style': 'quote'}, 'id': 'call_17iLPWvOD23zqwd1QVQ00Y63'}], usage_metadata={'input_tokens': 59, 'output_tokens': 28, 'total_tokens': 87})]}}\n", "----\n", "{'tools': {'messages': [ToolMessage(content='\"Dogs are known for their loyalty and friendliness, making them great companions for pirates on long sea voyages.\"', name='pet_expert', tool_call_id='call_17iLPWvOD23zqwd1QVQ00Y63')]}}\n", "----\n", - "{'agent': {'messages': [AIMessage(content='According to pirates, dogs are known for their loyalty and friendliness, making them great companions for pirates on long sea voyages.', response_metadata={'token_usage': {'completion_tokens': 27, 'prompt_tokens': 119, 'total_tokens': 146}, 'model_name': 'gpt-3.5-turbo-0125', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-5a30edc3-7be0-4743-b980-ca2f8cad9b8d-0', usage_metadata={'input_tokens': 119, 'output_tokens': 27, 'total_tokens': 146})]}}\n", + "{'agent': {'messages': [AIMessage(content='According to pirates, dogs are known for their loyalty and friendliness, making them great companions for pirates on long sea voyages.', response_metadata={'token_usage': {'completion_tokens': 27, 'prompt_tokens': 119, 'total_tokens': 146}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-5a30edc3-7be0-4743-b980-ca2f8cad9b8d-0', usage_metadata={'input_tokens': 119, 'output_tokens': 27, 'total_tokens': 146})]}}\n", "----\n" ] } diff --git a/docs/docs/how_to/fallbacks.ipynb b/docs/docs/how_to/fallbacks.ipynb index bdb234c83cc..1ed7f6bd315 100644 --- a/docs/docs/how_to/fallbacks.ipynb +++ b/docs/docs/how_to/fallbacks.ipynb @@ -90,7 +90,7 @@ "outputs": [], "source": [ "# Note that we set max_retries = 0 to avoid retrying on RateLimits, etc\n", - "openai_llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", max_retries=0)\n", + "openai_llm = ChatOpenAI(model=\"gpt-4o-mini\", max_retries=0)\n", "anthropic_llm = ChatAnthropic(model=\"claude-3-haiku-20240307\")\n", "llm = openai_llm.with_fallbacks([anthropic_llm])" ] diff --git a/docs/docs/how_to/few_shot_examples_chat.ipynb b/docs/docs/how_to/few_shot_examples_chat.ipynb index 986befd6930..19f00cf15dd 100644 --- a/docs/docs/how_to/few_shot_examples_chat.ipynb +++ b/docs/docs/how_to/few_shot_examples_chat.ipynb @@ -86,7 +86,7 @@ { "data": { "text/plain": [ - "AIMessage(content='The expression \"2 🦜 9\" is not a standard mathematical operation or equation. It appears to be a combination of the number 2 and the parrot emoji 🦜 followed by the number 9. It does not have a specific mathematical meaning.', response_metadata={'token_usage': {'completion_tokens': 54, 'prompt_tokens': 17, 'total_tokens': 71}, 'model_name': 'gpt-3.5-turbo-0125', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-aad12dda-5c47-4a1e-9949-6fe94e03242a-0', usage_metadata={'input_tokens': 17, 'output_tokens': 54, 'total_tokens': 71})" + "AIMessage(content='The expression \"2 🦜 9\" is not a standard mathematical operation or equation. It appears to be a combination of the number 2 and the parrot emoji 🦜 followed by the number 9. It does not have a specific mathematical meaning.', response_metadata={'token_usage': {'completion_tokens': 54, 'prompt_tokens': 17, 'total_tokens': 71}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-aad12dda-5c47-4a1e-9949-6fe94e03242a-0', usage_metadata={'input_tokens': 17, 'output_tokens': 54, 'total_tokens': 71})" ] }, "execution_count": 4, @@ -97,7 +97,7 @@ "source": [ "from langchain_openai import ChatOpenAI\n", "\n", - "model = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0.0)\n", + "model = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0.0)\n", "\n", "model.invoke(\"What is 2 🦜 9?\")" ] @@ -212,7 +212,7 @@ { "data": { "text/plain": [ - "AIMessage(content='11', response_metadata={'token_usage': {'completion_tokens': 1, 'prompt_tokens': 60, 'total_tokens': 61}, 'model_name': 'gpt-3.5-turbo-0125', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-5ec4e051-262f-408e-ad00-3f2ebeb561c3-0', usage_metadata={'input_tokens': 60, 'output_tokens': 1, 'total_tokens': 61})" + "AIMessage(content='11', response_metadata={'token_usage': {'completion_tokens': 1, 'prompt_tokens': 60, 'total_tokens': 61}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-5ec4e051-262f-408e-ad00-3f2ebeb561c3-0', usage_metadata={'input_tokens': 60, 'output_tokens': 1, 'total_tokens': 61})" ] }, "execution_count": 8, @@ -418,7 +418,7 @@ { "data": { "text/plain": [ - "AIMessage(content='6', response_metadata={'token_usage': {'completion_tokens': 1, 'prompt_tokens': 60, 'total_tokens': 61}, 'model_name': 'gpt-3.5-turbo-0125', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-d1863e5e-17cd-4e9d-bf7a-b9f118747a65-0', usage_metadata={'input_tokens': 60, 'output_tokens': 1, 'total_tokens': 61})" + "AIMessage(content='6', response_metadata={'token_usage': {'completion_tokens': 1, 'prompt_tokens': 60, 'total_tokens': 61}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-d1863e5e-17cd-4e9d-bf7a-b9f118747a65-0', usage_metadata={'input_tokens': 60, 'output_tokens': 1, 'total_tokens': 61})" ] }, "execution_count": 13, @@ -427,7 +427,7 @@ } ], "source": [ - "chain = final_prompt | ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0.0)\n", + "chain = final_prompt | ChatOpenAI(model=\"gpt-4o-mini\", temperature=0.0)\n", "\n", "chain.invoke({\"input\": \"What's 3 🦜 3?\"})" ] diff --git a/docs/docs/how_to/function_calling.ipynb b/docs/docs/how_to/function_calling.ipynb index 35a9063d655..541b26cc5cb 100644 --- a/docs/docs/how_to/function_calling.ipynb +++ b/docs/docs/how_to/function_calling.ipynb @@ -191,7 +191,7 @@ "\n", "from langchain_openai import ChatOpenAI\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0)" + "llm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)" ] }, { diff --git a/docs/docs/how_to/logprobs.ipynb b/docs/docs/how_to/logprobs.ipynb index d77a6b64fe5..b216bb4a915 100644 --- a/docs/docs/how_to/logprobs.ipynb +++ b/docs/docs/how_to/logprobs.ipynb @@ -94,7 +94,7 @@ "source": [ "from langchain_openai import ChatOpenAI\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\").bind(logprobs=True)\n", + "llm = ChatOpenAI(model=\"gpt-4o-mini\").bind(logprobs=True)\n", "\n", "msg = llm.invoke((\"human\", \"how are you today\"))\n", "\n", diff --git a/docs/docs/how_to/query_few_shot.ipynb b/docs/docs/how_to/query_few_shot.ipynb index 7a175cf222d..6ccfb79d088 100644 --- a/docs/docs/how_to/query_few_shot.ipynb +++ b/docs/docs/how_to/query_few_shot.ipynb @@ -143,7 +143,7 @@ " (\"human\", \"{question}\"),\n", " ]\n", ")\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0)\n", + "llm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)\n", "structured_llm = llm.with_structured_output(Search)\n", "query_analyzer = {\"question\": RunnablePassthrough()} | prompt | structured_llm" ] diff --git a/docs/docs/how_to/query_high_cardinality.ipynb b/docs/docs/how_to/query_high_cardinality.ipynb index 447a5fa3aca..bc42bc022d7 100644 --- a/docs/docs/how_to/query_high_cardinality.ipynb +++ b/docs/docs/how_to/query_high_cardinality.ipynb @@ -201,7 +201,7 @@ " (\"human\", \"{question}\"),\n", " ]\n", ")\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0)\n", + "llm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)\n", "structured_llm = llm.with_structured_output(Search)\n", "query_analyzer = {\"question\": RunnablePassthrough()} | prompt | structured_llm" ] diff --git a/docs/docs/how_to/query_multiple_queries.ipynb b/docs/docs/how_to/query_multiple_queries.ipynb index 223f7ebbb3e..9fc0e3dea28 100644 --- a/docs/docs/how_to/query_multiple_queries.ipynb +++ b/docs/docs/how_to/query_multiple_queries.ipynb @@ -159,7 +159,7 @@ " (\"human\", \"{question}\"),\n", " ]\n", ")\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0)\n", + "llm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)\n", "structured_llm = llm.with_structured_output(Search)\n", "query_analyzer = {\"question\": RunnablePassthrough()} | prompt | structured_llm" ] diff --git a/docs/docs/how_to/query_multiple_retrievers.ipynb b/docs/docs/how_to/query_multiple_retrievers.ipynb index 0000cda5f01..276a849b99c 100644 --- a/docs/docs/how_to/query_multiple_retrievers.ipynb +++ b/docs/docs/how_to/query_multiple_retrievers.ipynb @@ -154,7 +154,7 @@ " (\"human\", \"{question}\"),\n", " ]\n", ")\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0)\n", + "llm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)\n", "structured_llm = llm.with_structured_output(Search)\n", "query_analyzer = {\"question\": RunnablePassthrough()} | prompt | structured_llm" ] diff --git a/docs/docs/how_to/query_no_queries.ipynb b/docs/docs/how_to/query_no_queries.ipynb index 53d34d94eb6..c7a62cf5935 100644 --- a/docs/docs/how_to/query_no_queries.ipynb +++ b/docs/docs/how_to/query_no_queries.ipynb @@ -149,7 +149,7 @@ " (\"human\", \"{question}\"),\n", " ]\n", ")\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0)\n", + "llm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)\n", "structured_llm = llm.bind_tools([Search])\n", "query_analyzer = {\"question\": RunnablePassthrough()} | prompt | structured_llm" ] diff --git a/docs/docs/how_to/serialization.ipynb b/docs/docs/how_to/serialization.ipynb index 8638c8b8955..923835d5a40 100644 --- a/docs/docs/how_to/serialization.ipynb +++ b/docs/docs/how_to/serialization.ipynb @@ -44,7 +44,7 @@ " ],\n", ")\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", api_key=\"llm-api-key\")\n", + "llm = ChatOpenAI(model=\"gpt-4o-mini\", api_key=\"llm-api-key\")\n", "\n", "chain = prompt | llm" ] diff --git a/docs/docs/how_to/tool_calling_parallel.ipynb b/docs/docs/how_to/tool_calling_parallel.ipynb index 7c1175035a4..6567562d11b 100644 --- a/docs/docs/how_to/tool_calling_parallel.ipynb +++ b/docs/docs/how_to/tool_calling_parallel.ipynb @@ -59,7 +59,7 @@ "\n", "os.environ[\"OPENAI_API_KEY\"] = getpass()\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0)" + "llm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)" ] }, { diff --git a/docs/docs/how_to/tool_choice.ipynb b/docs/docs/how_to/tool_choice.ipynb index 762508292c4..531eef184d2 100644 --- a/docs/docs/how_to/tool_choice.ipynb +++ b/docs/docs/how_to/tool_choice.ipynb @@ -59,7 +59,7 @@ "\n", "os.environ[\"OPENAI_API_KEY\"] = getpass()\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0)" + "llm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)" ] }, { @@ -77,7 +77,7 @@ { "data": { "text/plain": [ - "AIMessage(content='', additional_kwargs={'tool_calls': [{'id': 'call_9cViskmLvPnHjXk9tbVla5HA', 'function': {'arguments': '{\"a\":2,\"b\":4}', 'name': 'Multiply'}, 'type': 'function'}]}, response_metadata={'token_usage': {'completion_tokens': 9, 'prompt_tokens': 103, 'total_tokens': 112}, 'model_name': 'gpt-3.5-turbo-0125', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-095b827e-2bdd-43bb-8897-c843f4504883-0', tool_calls=[{'name': 'Multiply', 'args': {'a': 2, 'b': 4}, 'id': 'call_9cViskmLvPnHjXk9tbVla5HA'}], usage_metadata={'input_tokens': 103, 'output_tokens': 9, 'total_tokens': 112})" + "AIMessage(content='', additional_kwargs={'tool_calls': [{'id': 'call_9cViskmLvPnHjXk9tbVla5HA', 'function': {'arguments': '{\"a\":2,\"b\":4}', 'name': 'Multiply'}, 'type': 'function'}]}, response_metadata={'token_usage': {'completion_tokens': 9, 'prompt_tokens': 103, 'total_tokens': 112}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-095b827e-2bdd-43bb-8897-c843f4504883-0', tool_calls=[{'name': 'Multiply', 'args': {'a': 2, 'b': 4}, 'id': 'call_9cViskmLvPnHjXk9tbVla5HA'}], usage_metadata={'input_tokens': 103, 'output_tokens': 9, 'total_tokens': 112})" ] }, "metadata": {}, @@ -111,7 +111,7 @@ { "data": { "text/plain": [ - "AIMessage(content='', additional_kwargs={'tool_calls': [{'id': 'call_mCSiJntCwHJUBfaHZVUB2D8W', 'function': {'arguments': '{\"a\":1,\"b\":2}', 'name': 'Add'}, 'type': 'function'}]}, response_metadata={'token_usage': {'completion_tokens': 15, 'prompt_tokens': 94, 'total_tokens': 109}, 'model_name': 'gpt-3.5-turbo-0125', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-28f75260-9900-4bed-8cd3-f1579abb65e5-0', tool_calls=[{'name': 'Add', 'args': {'a': 1, 'b': 2}, 'id': 'call_mCSiJntCwHJUBfaHZVUB2D8W'}], usage_metadata={'input_tokens': 94, 'output_tokens': 15, 'total_tokens': 109})" + "AIMessage(content='', additional_kwargs={'tool_calls': [{'id': 'call_mCSiJntCwHJUBfaHZVUB2D8W', 'function': {'arguments': '{\"a\":1,\"b\":2}', 'name': 'Add'}, 'type': 'function'}]}, response_metadata={'token_usage': {'completion_tokens': 15, 'prompt_tokens': 94, 'total_tokens': 109}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-28f75260-9900-4bed-8cd3-f1579abb65e5-0', tool_calls=[{'name': 'Add', 'args': {'a': 1, 'b': 2}, 'id': 'call_mCSiJntCwHJUBfaHZVUB2D8W'}], usage_metadata={'input_tokens': 94, 'output_tokens': 15, 'total_tokens': 109})" ] }, "metadata": {}, diff --git a/docs/docs/how_to/tool_runtime.ipynb b/docs/docs/how_to/tool_runtime.ipynb index 61b1ecd2f58..855060a8ead 100644 --- a/docs/docs/how_to/tool_runtime.ipynb +++ b/docs/docs/how_to/tool_runtime.ipynb @@ -71,7 +71,7 @@ "if \"OPENAI_API_KEY\" not in os.environ:\n", " os.environ[\"OPENAI_API_KEY\"] = getpass()\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0)" + "llm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)" ] }, { diff --git a/docs/docs/how_to/tool_streaming.ipynb b/docs/docs/how_to/tool_streaming.ipynb index 4994b55874a..e3b76d68e89 100644 --- a/docs/docs/how_to/tool_streaming.ipynb +++ b/docs/docs/how_to/tool_streaming.ipynb @@ -60,7 +60,7 @@ "\n", "os.environ[\"OPENAI_API_KEY\"] = getpass()\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0)\n", + "llm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)\n", "llm_with_tools = llm.bind_tools(tools)" ] }, diff --git a/docs/docs/how_to/tools_chain.ipynb b/docs/docs/how_to/tools_chain.ipynb index 387eb9890a4..c99044735bc 100644 --- a/docs/docs/how_to/tools_chain.ipynb +++ b/docs/docs/how_to/tools_chain.ipynb @@ -166,7 +166,7 @@ "\n", "from langchain_openai.chat_models import ChatOpenAI\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0)" + "llm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)" ] }, { diff --git a/docs/docs/how_to/tools_error.ipynb b/docs/docs/how_to/tools_error.ipynb index 0a23520cc0b..d1419c6b304 100644 --- a/docs/docs/how_to/tools_error.ipynb +++ b/docs/docs/how_to/tools_error.ipynb @@ -93,7 +93,7 @@ "\n", "os.environ[\"OPENAI_API_KEY\"] = getpass.getpass()\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0)" + "llm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)" ] }, { diff --git a/docs/docs/how_to/tools_few_shot.ipynb b/docs/docs/how_to/tools_few_shot.ipynb index c4f3570da1a..9f3b7e337de 100644 --- a/docs/docs/how_to/tools_few_shot.ipynb +++ b/docs/docs/how_to/tools_few_shot.ipynb @@ -48,7 +48,7 @@ "\n", "os.environ[\"OPENAI_API_KEY\"] = getpass()\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0)\n", + "llm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)\n", "llm_with_tools = llm.bind_tools(tools)" ] }, diff --git a/docs/docs/integrations/document_transformers/jina_rerank.ipynb b/docs/docs/integrations/document_transformers/jina_rerank.ipynb index 5585ecd4357..a914ddb6fbe 100644 --- a/docs/docs/integrations/document_transformers/jina_rerank.ipynb +++ b/docs/docs/integrations/document_transformers/jina_rerank.ipynb @@ -214,7 +214,7 @@ "source": [ "from langchain_openai import ChatOpenAI\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0)\n", + "llm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)\n", "combine_docs_chain = create_stuff_documents_chain(llm, retrieval_qa_chat_prompt)\n", "chain = create_retrieval_chain(compression_retriever, combine_docs_chain)" ] diff --git a/docs/docs/integrations/memory/couchbase_chat_message_history.ipynb b/docs/docs/integrations/memory/couchbase_chat_message_history.ipynb index 07500945b05..4f615e827b1 100644 --- a/docs/docs/integrations/memory/couchbase_chat_message_history.ipynb +++ b/docs/docs/integrations/memory/couchbase_chat_message_history.ipynb @@ -267,7 +267,7 @@ { "data": { "text/plain": [ - "AIMessage(content='Hello Bob! How can I assist you today?', response_metadata={'token_usage': {'completion_tokens': 10, 'prompt_tokens': 22, 'total_tokens': 32}, 'model_name': 'gpt-3.5-turbo-0125', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-a0f8a29e-ddf4-4e06-a1fe-cf8c325a2b72-0', usage_metadata={'input_tokens': 22, 'output_tokens': 10, 'total_tokens': 32})" + "AIMessage(content='Hello Bob! How can I assist you today?', response_metadata={'token_usage': {'completion_tokens': 10, 'prompt_tokens': 22, 'total_tokens': 32}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-a0f8a29e-ddf4-4e06-a1fe-cf8c325a2b72-0', usage_metadata={'input_tokens': 22, 'output_tokens': 10, 'total_tokens': 32})" ] }, "execution_count": 11, @@ -288,7 +288,7 @@ { "data": { "text/plain": [ - "AIMessage(content='Your name is Bob.', response_metadata={'token_usage': {'completion_tokens': 5, 'prompt_tokens': 43, 'total_tokens': 48}, 'model_name': 'gpt-3.5-turbo-0125', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-f764a9eb-999e-4042-96b6-fe47b7ae4779-0', usage_metadata={'input_tokens': 43, 'output_tokens': 5, 'total_tokens': 48})" + "AIMessage(content='Your name is Bob.', response_metadata={'token_usage': {'completion_tokens': 5, 'prompt_tokens': 43, 'total_tokens': 48}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-f764a9eb-999e-4042-96b6-fe47b7ae4779-0', usage_metadata={'input_tokens': 43, 'output_tokens': 5, 'total_tokens': 48})" ] }, "execution_count": 12, diff --git a/docs/docs/integrations/retrievers/azure_ai_search.ipynb b/docs/docs/integrations/retrievers/azure_ai_search.ipynb index 7c235b3767f..c308d46319d 100644 --- a/docs/docs/integrations/retrievers/azure_ai_search.ipynb +++ b/docs/docs/integrations/retrievers/azure_ai_search.ipynb @@ -304,7 +304,7 @@ "Question: {question}\"\"\"\n", ")\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\")\n", + "llm = ChatOpenAI(model=\"gpt-4o-mini\")\n", "\n", "\n", "def format_docs(docs):\n", diff --git a/docs/docs/integrations/retrievers/box.ipynb b/docs/docs/integrations/retrievers/box.ipynb index 5de63d3d2f3..8860c479e75 100644 --- a/docs/docs/integrations/retrievers/box.ipynb +++ b/docs/docs/integrations/retrievers/box.ipynb @@ -220,7 +220,7 @@ "\n", "from langchain_openai import ChatOpenAI\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0)" + "llm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)" ] }, { diff --git a/docs/docs/integrations/retrievers/elasticsearch_retriever.ipynb b/docs/docs/integrations/retrievers/elasticsearch_retriever.ipynb index 88319281fc5..774c20165bd 100644 --- a/docs/docs/integrations/retrievers/elasticsearch_retriever.ipynb +++ b/docs/docs/integrations/retrievers/elasticsearch_retriever.ipynb @@ -645,7 +645,7 @@ "Question: {question}\"\"\"\n", ")\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\")\n", + "llm = ChatOpenAI(model=\"gpt-4o-mini\")\n", "\n", "\n", "def format_docs(docs):\n", diff --git a/docs/docs/integrations/retrievers/tavily.ipynb b/docs/docs/integrations/retrievers/tavily.ipynb index d6c70fb1fb9..739eb1d274f 100644 --- a/docs/docs/integrations/retrievers/tavily.ipynb +++ b/docs/docs/integrations/retrievers/tavily.ipynb @@ -161,7 +161,7 @@ "Question: {question}\"\"\"\n", ")\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\")\n", + "llm = ChatOpenAI(model=\"gpt-4o-mini\")\n", "\n", "\n", "def format_docs(docs):\n", diff --git a/docs/docs/integrations/retrievers/wikipedia.ipynb b/docs/docs/integrations/retrievers/wikipedia.ipynb index 57798aaf152..97c3b808830 100644 --- a/docs/docs/integrations/retrievers/wikipedia.ipynb +++ b/docs/docs/integrations/retrievers/wikipedia.ipynb @@ -171,7 +171,7 @@ "\n", "from langchain_openai import ChatOpenAI\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0)" + "llm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)" ] }, { diff --git a/docs/docs/integrations/tools/github.ipynb b/docs/docs/integrations/tools/github.ipynb index aaab3ce857f..d6348a2f31e 100644 --- a/docs/docs/integrations/tools/github.ipynb +++ b/docs/docs/integrations/tools/github.ipynb @@ -226,7 +226,7 @@ "\n", "from langchain_openai import ChatOpenAI\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0)" + "llm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)" ] }, { diff --git a/docs/docs/integrations/tools/gmail.ipynb b/docs/docs/integrations/tools/gmail.ipynb index 64772bf8d2b..e3502fc6b1e 100644 --- a/docs/docs/integrations/tools/gmail.ipynb +++ b/docs/docs/integrations/tools/gmail.ipynb @@ -177,7 +177,7 @@ "\n", "from langchain_openai import ChatOpenAI\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0)" + "llm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)" ] }, { diff --git a/docs/docs/integrations/tools/requests.ipynb b/docs/docs/integrations/tools/requests.ipynb index 483388e0342..5fbcc1b3a7f 100644 --- a/docs/docs/integrations/tools/requests.ipynb +++ b/docs/docs/integrations/tools/requests.ipynb @@ -250,7 +250,7 @@ "from langchain_openai import ChatOpenAI\n", "from langgraph.prebuilt import create_react_agent\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\")\n", + "llm = ChatOpenAI(model=\"gpt-4o-mini\")\n", "\n", "system_message = \"\"\"\n", "You have access to an API to help answer user queries.\n", diff --git a/docs/docs/integrations/tools/slack.ipynb b/docs/docs/integrations/tools/slack.ipynb index 2f2c98a1009..cbc119b3881 100644 --- a/docs/docs/integrations/tools/slack.ipynb +++ b/docs/docs/integrations/tools/slack.ipynb @@ -161,7 +161,7 @@ "from langchain_openai import ChatOpenAI\n", "from langgraph.prebuilt import create_react_agent\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\")\n", + "llm = ChatOpenAI(model=\"gpt-4o-mini\")\n", "\n", "agent_executor = create_react_agent(llm, tools)" ] diff --git a/docs/docs/tutorials/chatbot.ipynb b/docs/docs/tutorials/chatbot.ipynb index 996892c9bc1..c05db80cb74 100644 --- a/docs/docs/tutorials/chatbot.ipynb +++ b/docs/docs/tutorials/chatbot.ipynb @@ -143,7 +143,7 @@ { "data": { "text/plain": [ - "AIMessage(content='Hello Bob! How can I assist you today?', response_metadata={'token_usage': {'completion_tokens': 10, 'prompt_tokens': 12, 'total_tokens': 22}, 'model_name': 'gpt-3.5-turbo-0125', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-d939617f-0c3b-45e9-a93f-13dafecbd4b5-0', usage_metadata={'input_tokens': 12, 'output_tokens': 10, 'total_tokens': 22})" + "AIMessage(content='Hello Bob! How can I assist you today?', response_metadata={'token_usage': {'completion_tokens': 10, 'prompt_tokens': 12, 'total_tokens': 22}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-d939617f-0c3b-45e9-a93f-13dafecbd4b5-0', usage_metadata={'input_tokens': 12, 'output_tokens': 10, 'total_tokens': 22})" ] }, "execution_count": 2, @@ -172,7 +172,7 @@ { "data": { "text/plain": [ - "AIMessage(content=\"I'm sorry, I don't have access to personal information unless you provide it to me. How may I assist you today?\", response_metadata={'token_usage': {'completion_tokens': 26, 'prompt_tokens': 12, 'total_tokens': 38}, 'model_name': 'gpt-3.5-turbo-0125', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-47bc8c20-af7b-4fd2-9345-f0e9fdf18ce3-0', usage_metadata={'input_tokens': 12, 'output_tokens': 26, 'total_tokens': 38})" + "AIMessage(content=\"I'm sorry, I don't have access to personal information unless you provide it to me. How may I assist you today?\", response_metadata={'token_usage': {'completion_tokens': 26, 'prompt_tokens': 12, 'total_tokens': 38}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-47bc8c20-af7b-4fd2-9345-f0e9fdf18ce3-0', usage_metadata={'input_tokens': 12, 'output_tokens': 26, 'total_tokens': 38})" ] }, "execution_count": 3, @@ -204,7 +204,7 @@ { "data": { "text/plain": [ - "AIMessage(content='Your name is Bob. How can I help you, Bob?', response_metadata={'token_usage': {'completion_tokens': 13, 'prompt_tokens': 35, 'total_tokens': 48}, 'model_name': 'gpt-3.5-turbo-0125', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-9f90291b-4df9-41dc-9ecf-1ee1081f4490-0', usage_metadata={'input_tokens': 35, 'output_tokens': 13, 'total_tokens': 48})" + "AIMessage(content='Your name is Bob. How can I help you, Bob?', response_metadata={'token_usage': {'completion_tokens': 13, 'prompt_tokens': 35, 'total_tokens': 48}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-9f90291b-4df9-41dc-9ecf-1ee1081f4490-0', usage_metadata={'input_tokens': 35, 'output_tokens': 13, 'total_tokens': 48})" ] }, "execution_count": 4, diff --git a/docs/docs/tutorials/classification.ipynb b/docs/docs/tutorials/classification.ipynb index 9493e04f80f..2df9b4a1a53 100644 --- a/docs/docs/tutorials/classification.ipynb +++ b/docs/docs/tutorials/classification.ipynb @@ -96,7 +96,7 @@ "\n", "\n", "# LLM\n", - "llm = ChatOpenAI(temperature=0, model=\"gpt-3.5-turbo-0125\").with_structured_output(\n", + "llm = ChatOpenAI(temperature=0, model=\"gpt-4o-mini\").with_structured_output(\n", " Classification\n", ")\n", "\n", @@ -229,7 +229,7 @@ "\"\"\"\n", ")\n", "\n", - "llm = ChatOpenAI(temperature=0, model=\"gpt-3.5-turbo-0125\").with_structured_output(\n", + "llm = ChatOpenAI(temperature=0, model=\"gpt-4o-mini\").with_structured_output(\n", " Classification\n", ")\n", "\n", diff --git a/docs/docs/tutorials/query_analysis.ipynb b/docs/docs/tutorials/query_analysis.ipynb index 2345f33cbe0..9433bbd1958 100644 --- a/docs/docs/tutorials/query_analysis.ipynb +++ b/docs/docs/tutorials/query_analysis.ipynb @@ -430,7 +430,7 @@ " (\"human\", \"{question}\"),\n", " ]\n", ")\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0)\n", + "llm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)\n", "structured_llm = llm.with_structured_output(Search)\n", "query_analyzer = {\"question\": RunnablePassthrough()} | prompt | structured_llm" ] diff --git a/docs/docs/versions/migrating_chains/map_reduce_chain.ipynb b/docs/docs/versions/migrating_chains/map_reduce_chain.ipynb index 197de18a1e3..52fad8721ea 100644 --- a/docs/docs/versions/migrating_chains/map_reduce_chain.ipynb +++ b/docs/docs/versions/migrating_chains/map_reduce_chain.ipynb @@ -46,7 +46,7 @@ "\n", "from langchain_openai import ChatOpenAI\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0)" + "llm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)" ] }, { diff --git a/docs/docs/versions/migrating_chains/stuff_docs_chain.ipynb b/docs/docs/versions/migrating_chains/stuff_docs_chain.ipynb index fa4721caa3e..2d28e1f2d58 100644 --- a/docs/docs/versions/migrating_chains/stuff_docs_chain.ipynb +++ b/docs/docs/versions/migrating_chains/stuff_docs_chain.ipynb @@ -32,7 +32,7 @@ "\n", "from langchain_openai import ChatOpenAI\n", "\n", - "llm = ChatOpenAI(model=\"gpt-3.5-turbo-0125\", temperature=0)" + "llm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)" ] }, {