From faa8e3155b0d327bd4097e58107b25702f56c06e Mon Sep 17 00:00:00 2001 From: Tsyupryk Roman Date: Mon, 7 Jul 2025 20:01:13 +0200 Subject: [PATCH 1/3] Refactor basics.ipynb and update requirements.txt to include langchain-tavily --- module-0/basics.ipynb | 44 +++++++++++++++++++++++++++---------------- requirements.txt | 3 ++- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/module-0/basics.ipynb b/module-0/basics.ipynb index 04ec69517..e8a6bc0b3 100644 --- a/module-0/basics.ipynb +++ b/module-0/basics.ipynb @@ -42,7 +42,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "0f9a52c8", "metadata": {}, "outputs": [], @@ -53,7 +53,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "id": "c2a15227", "metadata": {}, "outputs": [], @@ -84,7 +84,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "id": "e19a54d3", "metadata": {}, "outputs": [], @@ -109,17 +109,17 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "id": "b1280e1b", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "AIMessage(content='Hello! How can I assist you today?', additional_kwargs={'refusal': None}, response_metadata={'token_usage': {'completion_tokens': 9, 'prompt_tokens': 11, 'total_tokens': 20}, 'model_name': 'gpt-4o-2024-05-13', 'system_fingerprint': 'fp_157b3831f5', 'finish_reason': 'stop', 'logprobs': None}, id='run-d3c4bc85-ef14-49f6-ba7e-91bf455cffee-0', usage_metadata={'input_tokens': 11, 'output_tokens': 9, 'total_tokens': 20})" + "AIMessage(content='Hello! How can I assist you today?', additional_kwargs={'refusal': None}, response_metadata={'token_usage': {'completion_tokens': 9, 'prompt_tokens': 11, 'total_tokens': 20, 'completion_tokens_details': {'accepted_prediction_tokens': 0, 'audio_tokens': 0, 'reasoning_tokens': 0, 'rejected_prediction_tokens': 0}, 'prompt_tokens_details': {'audio_tokens': 0, 'cached_tokens': 0}}, 'model_name': 'gpt-4o-2024-08-06', 'system_fingerprint': 'fp_07871e2ad8', 'id': 'chatcmpl-Bqk5I6GrSyvnN8NK0FEn6o9GDM9k1', 'service_tier': 'default', 'finish_reason': 'stop', 'logprobs': None}, id='run--fb307041-ce44-4119-8cb9-9f89210d331a-0', usage_metadata={'input_tokens': 11, 'output_tokens': 9, 'total_tokens': 20, 'input_token_details': {'audio': 0, 'cache_read': 0}, 'output_token_details': {'audio': 0, 'reasoning': 0}})" ] }, - "execution_count": 3, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -147,17 +147,17 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "id": "f27c6c9a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "AIMessage(content='Hello! How can I assist you today?', additional_kwargs={'refusal': None}, response_metadata={'token_usage': {'completion_tokens': 9, 'prompt_tokens': 9, 'total_tokens': 18}, 'model_name': 'gpt-4o-2024-05-13', 'system_fingerprint': 'fp_157b3831f5', 'finish_reason': 'stop', 'logprobs': None}, id='run-d6f6b682-e29a-44de-b45e-79fad1e405e5-0', usage_metadata={'input_tokens': 9, 'output_tokens': 9, 'total_tokens': 18})" + "AIMessage(content='Hello! How can I assist you today?', additional_kwargs={'refusal': None}, response_metadata={'token_usage': {'completion_tokens': 9, 'prompt_tokens': 9, 'total_tokens': 18, 'completion_tokens_details': {'accepted_prediction_tokens': 0, 'audio_tokens': 0, 'reasoning_tokens': 0, 'rejected_prediction_tokens': 0}, 'prompt_tokens_details': {'audio_tokens': 0, 'cached_tokens': 0}}, 'model_name': 'gpt-4o-2024-08-06', 'system_fingerprint': 'fp_07871e2ad8', 'id': 'chatcmpl-Bqk5SlpwqNhsc6xPhFfsoQsv7nAZm', 'service_tier': 'default', 'finish_reason': 'stop', 'logprobs': None}, id='run--f843a940-0b31-476d-83a7-34b2fafa5814-0', usage_metadata={'input_tokens': 9, 'output_tokens': 9, 'total_tokens': 18, 'input_token_details': {'audio': 0, 'cache_read': 0}, 'output_token_details': {'audio': 0, 'reasoning': 0}})" ] }, - "execution_count": 4, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -219,13 +219,25 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 9, "id": "52d69da9", "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "ModuleNotFoundError", + "evalue": "No module named 'langchain_tavily'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[9], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;21;01mlangchain_tavily\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mimport\u001b[39;00m TavilySearch\n\u001b[1;32m 2\u001b[0m tavily_search \u001b[38;5;241m=\u001b[39m TavilySearch(max_results\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m3\u001b[39m)\n\u001b[1;32m 3\u001b[0m search_docs \u001b[38;5;241m=\u001b[39m tavily_search\u001b[38;5;241m.\u001b[39minvoke(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mWhat is LangGraph?\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n", + "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'langchain_tavily'" + ] + } + ], "source": [ - "from langchain_community.tools.tavily_search import TavilySearchResults\n", - "tavily_search = TavilySearchResults(max_results=3)\n", + "from langchain_tavily import TavilySearch\n", + "tavily_search = TavilySearch(max_results=3)\n", "search_docs = tavily_search.invoke(\"What is LangGraph?\")" ] }, @@ -266,9 +278,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python [conda env:base] *", "language": "python", - "name": "python3" + "name": "conda-base-py" }, "language_info": { "codemirror_mode": { @@ -280,7 +292,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.1" + "version": "3.13.5" } }, "nbformat": 4, diff --git a/requirements.txt b/requirements.txt index f3cfd4217..ca432f47b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,6 +8,7 @@ langchain-core langchain-openai notebook tavily-python +langchain-tavily wikipedia trustcall -langgraph-cli[inmem] \ No newline at end of file +langgraph-cli[inmem] From 9e8207fd3ed9e729d00c7815b184096976ee1359 Mon Sep 17 00:00:00 2001 From: Tsyupryk Roman Date: Mon, 7 Jul 2025 20:08:31 +0200 Subject: [PATCH 2/3] Revert "Refactor basics.ipynb and update requirements.txt to include langchain-tavily" This reverts commit faa8e3155b0d327bd4097e58107b25702f56c06e. --- module-0/basics.ipynb | 44 ++++++++++++++++--------------------------- requirements.txt | 3 +-- 2 files changed, 17 insertions(+), 30 deletions(-) diff --git a/module-0/basics.ipynb b/module-0/basics.ipynb index e8a6bc0b3..04ec69517 100644 --- a/module-0/basics.ipynb +++ b/module-0/basics.ipynb @@ -42,7 +42,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "0f9a52c8", "metadata": {}, "outputs": [], @@ -53,7 +53,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "id": "c2a15227", "metadata": {}, "outputs": [], @@ -84,7 +84,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 2, "id": "e19a54d3", "metadata": {}, "outputs": [], @@ -109,17 +109,17 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "id": "b1280e1b", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "AIMessage(content='Hello! How can I assist you today?', additional_kwargs={'refusal': None}, response_metadata={'token_usage': {'completion_tokens': 9, 'prompt_tokens': 11, 'total_tokens': 20, 'completion_tokens_details': {'accepted_prediction_tokens': 0, 'audio_tokens': 0, 'reasoning_tokens': 0, 'rejected_prediction_tokens': 0}, 'prompt_tokens_details': {'audio_tokens': 0, 'cached_tokens': 0}}, 'model_name': 'gpt-4o-2024-08-06', 'system_fingerprint': 'fp_07871e2ad8', 'id': 'chatcmpl-Bqk5I6GrSyvnN8NK0FEn6o9GDM9k1', 'service_tier': 'default', 'finish_reason': 'stop', 'logprobs': None}, id='run--fb307041-ce44-4119-8cb9-9f89210d331a-0', usage_metadata={'input_tokens': 11, 'output_tokens': 9, 'total_tokens': 20, 'input_token_details': {'audio': 0, 'cache_read': 0}, 'output_token_details': {'audio': 0, 'reasoning': 0}})" + "AIMessage(content='Hello! How can I assist you today?', additional_kwargs={'refusal': None}, response_metadata={'token_usage': {'completion_tokens': 9, 'prompt_tokens': 11, 'total_tokens': 20}, 'model_name': 'gpt-4o-2024-05-13', 'system_fingerprint': 'fp_157b3831f5', 'finish_reason': 'stop', 'logprobs': None}, id='run-d3c4bc85-ef14-49f6-ba7e-91bf455cffee-0', usage_metadata={'input_tokens': 11, 'output_tokens': 9, 'total_tokens': 20})" ] }, - "execution_count": 4, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -147,17 +147,17 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "id": "f27c6c9a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "AIMessage(content='Hello! How can I assist you today?', additional_kwargs={'refusal': None}, response_metadata={'token_usage': {'completion_tokens': 9, 'prompt_tokens': 9, 'total_tokens': 18, 'completion_tokens_details': {'accepted_prediction_tokens': 0, 'audio_tokens': 0, 'reasoning_tokens': 0, 'rejected_prediction_tokens': 0}, 'prompt_tokens_details': {'audio_tokens': 0, 'cached_tokens': 0}}, 'model_name': 'gpt-4o-2024-08-06', 'system_fingerprint': 'fp_07871e2ad8', 'id': 'chatcmpl-Bqk5SlpwqNhsc6xPhFfsoQsv7nAZm', 'service_tier': 'default', 'finish_reason': 'stop', 'logprobs': None}, id='run--f843a940-0b31-476d-83a7-34b2fafa5814-0', usage_metadata={'input_tokens': 9, 'output_tokens': 9, 'total_tokens': 18, 'input_token_details': {'audio': 0, 'cache_read': 0}, 'output_token_details': {'audio': 0, 'reasoning': 0}})" + "AIMessage(content='Hello! How can I assist you today?', additional_kwargs={'refusal': None}, response_metadata={'token_usage': {'completion_tokens': 9, 'prompt_tokens': 9, 'total_tokens': 18}, 'model_name': 'gpt-4o-2024-05-13', 'system_fingerprint': 'fp_157b3831f5', 'finish_reason': 'stop', 'logprobs': None}, id='run-d6f6b682-e29a-44de-b45e-79fad1e405e5-0', usage_metadata={'input_tokens': 9, 'output_tokens': 9, 'total_tokens': 18})" ] }, - "execution_count": 5, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -219,25 +219,13 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 6, "id": "52d69da9", "metadata": {}, - "outputs": [ - { - "ename": "ModuleNotFoundError", - "evalue": "No module named 'langchain_tavily'", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[9], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;21;01mlangchain_tavily\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mimport\u001b[39;00m TavilySearch\n\u001b[1;32m 2\u001b[0m tavily_search \u001b[38;5;241m=\u001b[39m TavilySearch(max_results\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m3\u001b[39m)\n\u001b[1;32m 3\u001b[0m search_docs \u001b[38;5;241m=\u001b[39m tavily_search\u001b[38;5;241m.\u001b[39minvoke(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mWhat is LangGraph?\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n", - "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'langchain_tavily'" - ] - } - ], + "outputs": [], "source": [ - "from langchain_tavily import TavilySearch\n", - "tavily_search = TavilySearch(max_results=3)\n", + "from langchain_community.tools.tavily_search import TavilySearchResults\n", + "tavily_search = TavilySearchResults(max_results=3)\n", "search_docs = tavily_search.invoke(\"What is LangGraph?\")" ] }, @@ -278,9 +266,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python [conda env:base] *", + "display_name": "Python 3 (ipykernel)", "language": "python", - "name": "conda-base-py" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -292,7 +280,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.13.5" + "version": "3.12.1" } }, "nbformat": 4, diff --git a/requirements.txt b/requirements.txt index ca432f47b..f3cfd4217 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,6 @@ langchain-core langchain-openai notebook tavily-python -langchain-tavily wikipedia trustcall -langgraph-cli[inmem] +langgraph-cli[inmem] \ No newline at end of file From 1276d2776f825d245b2d6816e5e9caad3a05a38e Mon Sep 17 00:00:00 2001 From: Tsyupryk Roman Date: Mon, 7 Jul 2025 20:10:27 +0200 Subject: [PATCH 3/3] Refactor basics.ipynb and update requirements.txt to include langchain-tavily --- module-0/basics.ipynb | 4 ++-- requirements.txt | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/module-0/basics.ipynb b/module-0/basics.ipynb index 04ec69517..741852aac 100644 --- a/module-0/basics.ipynb +++ b/module-0/basics.ipynb @@ -224,8 +224,8 @@ "metadata": {}, "outputs": [], "source": [ - "from langchain_community.tools.tavily_search import TavilySearchResults\n", - "tavily_search = TavilySearchResults(max_results=3)\n", + "from langchain_tavily import TavilySearch\n", + "tavily_search = TavilySearch(max_results=3)\n", "search_docs = tavily_search.invoke(\"What is LangGraph?\")" ] }, diff --git a/requirements.txt b/requirements.txt index f3cfd4217..1b5cff041 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,4 +10,5 @@ notebook tavily-python wikipedia trustcall -langgraph-cli[inmem] \ No newline at end of file +langgraph-cli[inmem] +langchain-tavily