Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Added langchain-community install to the integrations chat #23510

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs/integrations/chat/ai21.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
11 changes: 10 additions & 1 deletion docs/docs/integrations/chat/alibaba_cloud_pai_eas.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@
"Another option is to use this code:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%pip install -qU langchain-community"
]
},
{
"cell_type": "code",
"execution_count": 9,
Expand Down Expand Up @@ -134,4 +143,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
6 changes: 3 additions & 3 deletions docs/docs/integrations/chat/anthropic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
"\n",
"| Class | Package | Local | Serializable | [JS support](https://js.langchain.com/v0.2/docs/integrations/chat/anthropic) | Package downloads | Package latest |\n",
"| :--- | :--- | :---: | :---: | :---: | :---: | :---: |\n",
"| [ChatAnthropic](https://api.python.langchain.com/en/latest/chat_models/langchain_anthropic.chat_models.ChatAnthropic.html) | [langchain-anthropic](https://api.python.langchain.com/en/latest/anthropic_api_reference.html) | | beta | | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-anthropic?style=flat-square&label=%20) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-anthropic?style=flat-square&label=%20) |\n",
"| [ChatAnthropic](https://api.python.langchain.com/en/latest/chat_models/langchain_anthropic.chat_models.ChatAnthropic.html) | [langchain-anthropic](https://api.python.langchain.com/en/latest/anthropic_api_reference.html) | \u274c | beta | \u2705 | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-anthropic?style=flat-square&label=%20) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-anthropic?style=flat-square&label=%20) |\n",
"\n",
"### Model features\n",
"| [Tool calling](/docs/how_to/tool_calling/) | [Structured output](/docs/how_to/structured_output/) | JSON mode | [Image input](/docs/how_to/multimodal_inputs/) | Audio input | Video input | [Token-level streaming](/docs/how_to/chat_streaming/) | Native async | [Token usage](/docs/how_to/chat_token_usage_tracking/) | [Logprobs](/docs/how_to/logprobs/) |\n",
"| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |\n",
"| | | | | | | | | | | \n",
"| \u2705 | \u2705 | \u274c | \u2705 | \u274c | \u274c | \u2705 | \u2705 | \u2705 | \u274c | \n",
"\n",
"## Setup\n",
"\n",
Expand Down Expand Up @@ -346,4 +346,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
2 changes: 1 addition & 1 deletion docs/docs/integrations/chat/anthropic_functions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
16 changes: 8 additions & 8 deletions docs/docs/integrations/chat/anyscale.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"outputs": [],
"source": [
"%pip install --upgrade --quiet langchain-openai"
"%pip install --upgrade --quiet langchain-openai langchain-community"
]
},
{
Expand All @@ -46,7 +46,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
" ········\n"
" \u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n"
]
}
],
Expand Down Expand Up @@ -163,11 +163,11 @@
"\n",
"\tmeta-llama/Llama-2-7b-chat-hf\n",
"\n",
"Ah, a fellow tech enthusiast! *adjusts glasses* I'm glad to share some technical details about myself. 🤓\n",
"Indeed, I'm a transformer model, specifically a BERT-like language model trained on a large corpus of text data. My architecture is based on the transformer framework, which is a type of neural network designed for natural language processing tasks. 🏠\n",
"As for the number of parameters, I have approximately 340 million. *winks* That's a pretty hefty number, if I do say so myself! These parameters allow me to learn and represent complex patterns in language, such as syntax, semantics, and more. 🤔\n",
"But don't ask me to do math in my head I'm a language model, not a calculating machine! 😅 My strengths lie in understanding and generating human-like text, so feel free to chat with me anytime you'd like. 💬\n",
"Now, do you have any more technical questions for me? Or would you like to engage in a nice chat? 😊\n",
"Ah, a fellow tech enthusiast! *adjusts glasses* I'm glad to share some technical details about myself. \ud83e\udd13\n",
"Indeed, I'm a transformer model, specifically a BERT-like language model trained on a large corpus of text data. My architecture is based on the transformer framework, which is a type of neural network designed for natural language processing tasks. \ud83c\udfe0\n",
"As for the number of parameters, I have approximately 340 million. *winks* That's a pretty hefty number, if I do say so myself! These parameters allow me to learn and represent complex patterns in language, such as syntax, semantics, and more. \ud83e\udd14\n",
"But don't ask me to do math in my head \u2013 I'm a language model, not a calculating machine! \ud83d\ude05 My strengths lie in understanding and generating human-like text, so feel free to chat with me anytime you'd like. \ud83d\udcac\n",
"Now, do you have any more technical questions for me? Or would you like to engage in a nice chat? \ud83d\ude0a\n",
"\n",
"---\n",
"\n",
Expand Down Expand Up @@ -228,4 +228,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
4 changes: 2 additions & 2 deletions docs/docs/integrations/chat/azure_chat_openai.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"metadata": {},
"outputs": [],
"source": [
"%pip install -qU langchain-openai"
"%pip install -qU langchain-openai langchain-community"
]
},
{
Expand Down Expand Up @@ -213,4 +213,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
11 changes: 10 additions & 1 deletion docs/docs/integrations/chat/azureml_chat_endpoint.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
"This notebook goes over how to use a chat model hosted on an `Azure Machine Learning Endpoint`."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%pip install -qU langchain-community"
]
},
{
"cell_type": "code",
"execution_count": 2,
Expand Down Expand Up @@ -199,4 +208,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
19 changes: 14 additions & 5 deletions docs/docs/integrations/chat/baichuan.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@
"Baichuan chat models API by Baichuan Intelligent Technology. For more information, see [https://platform.baichuan-ai.com/docs/api](https://platform.baichuan-ai.com/docs/api)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%pip install -qU langchain-community"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand Down Expand Up @@ -78,7 +87,7 @@
{
"data": {
"text/plain": [
"AIMessage(content='首先,我们需要确定闰年的二月有多少天。闰年的二月有29天。\\n\\n然后,我们可以计算你的月薪:\\n\\n日薪 = 月薪 / (当月天数)\\n\\n所以,你的月薪 = 日薪 * 当月天数\\n\\n将数值代入公式:\\n\\n月薪 = 8元/天 * 29天 = 232元\\n\\n因此,你在闰年的二月的月薪是232元。')"
"AIMessage(content='\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u786e\u5b9a\u95f0\u5e74\u7684\u4e8c\u6708\u6709\u591a\u5c11\u5929\u3002\u95f0\u5e74\u7684\u4e8c\u6708\u670929\u5929\u3002\\n\\n\u7136\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u8ba1\u7b97\u4f60\u7684\u6708\u85aa\uff1a\\n\\n\u65e5\u85aa = \u6708\u85aa / (\u5f53\u6708\u5929\u6570)\\n\\n\u6240\u4ee5\uff0c\u4f60\u7684\u6708\u85aa = \u65e5\u85aa * \u5f53\u6708\u5929\u6570\\n\\n\u5c06\u6570\u503c\u4ee3\u5165\u516c\u5f0f\uff1a\\n\\n\u6708\u85aa = 8\u5143/\u5929 * 29\u5929 = 232\u5143\\n\\n\u56e0\u6b64\uff0c\u4f60\u5728\u95f0\u5e74\u7684\u4e8c\u6708\u7684\u6708\u85aa\u662f232\u5143\u3002')"
]
},
"execution_count": 3,
Expand All @@ -87,7 +96,7 @@
}
],
"source": [
"chat([HumanMessage(content=\"我日薪8块钱,请问在闰年的二月,我月薪多少\")])"
"chat([HumanMessage(content=\"\u6211\u65e5\u85aa8\u5757\u94b1\uff0c\u8bf7\u95ee\u5728\u95f0\u5e74\u7684\u4e8c\u6708\uff0c\u6211\u6708\u85aa\u591a\u5c11\")])"
]
},
{
Expand Down Expand Up @@ -131,7 +140,7 @@
{
"data": {
"text/plain": [
"AIMessageChunk(content='首先,我们需要确定闰年的二月有多少天。闰年的二月有29天。\\n\\n然后,我们可以计算你的月薪:\\n\\n日薪 = 月薪 / (当月天数)\\n\\n所以,你的月薪 = 日薪 * 当月天数\\n\\n将数值代入公式:\\n\\n月薪 = 8元/天 * 29天 = 232元\\n\\n因此,你在闰年的二月的月薪是232元。')"
"AIMessageChunk(content='\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u786e\u5b9a\u95f0\u5e74\u7684\u4e8c\u6708\u6709\u591a\u5c11\u5929\u3002\u95f0\u5e74\u7684\u4e8c\u6708\u670929\u5929\u3002\\n\\n\u7136\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u8ba1\u7b97\u4f60\u7684\u6708\u85aa\uff1a\\n\\n\u65e5\u85aa = \u6708\u85aa / (\u5f53\u6708\u5929\u6570)\\n\\n\u6240\u4ee5\uff0c\u4f60\u7684\u6708\u85aa = \u65e5\u85aa * \u5f53\u6708\u5929\u6570\\n\\n\u5c06\u6570\u503c\u4ee3\u5165\u516c\u5f0f\uff1a\\n\\n\u6708\u85aa = 8\u5143/\u5929 * 29\u5929 = 232\u5143\\n\\n\u56e0\u6b64\uff0c\u4f60\u5728\u95f0\u5e74\u7684\u4e8c\u6708\u7684\u6708\u85aa\u662f232\u5143\u3002')"
]
},
"execution_count": 6,
Expand All @@ -140,7 +149,7 @@
}
],
"source": [
"chat([HumanMessage(content=\"我日薪8块钱,请问在闰年的二月,我月薪多少\")])"
"chat([HumanMessage(content=\"\u6211\u65e5\u85aa8\u5757\u94b1\uff0c\u8bf7\u95ee\u5728\u95f0\u5e74\u7684\u4e8c\u6708\uff0c\u6211\u6708\u85aa\u591a\u5c11\")])"
]
}
],
Expand All @@ -165,4 +174,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
23 changes: 16 additions & 7 deletions docs/docs/integrations/chat/baidu_qianfan_endpoint.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@
"## Set up"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%pip install -qU langchain-community"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand Down Expand Up @@ -91,7 +100,7 @@
{
"data": {
"text/plain": [
"AIMessage(content='您好!请问您需要什么帮助?我将尽力回答您的问题。')"
"AIMessage(content='\u60a8\u597d\uff01\u8bf7\u95ee\u60a8\u9700\u8981\u4ec0\u4e48\u5e2e\u52a9\uff1f\u6211\u5c06\u5c3d\u529b\u56de\u7b54\u60a8\u7684\u95ee\u9898\u3002')"
]
},
"execution_count": 2,
Expand All @@ -113,7 +122,7 @@
{
"data": {
"text/plain": [
"AIMessage(content='您好!有什么我可以帮助您的吗?')"
"AIMessage(content='\u60a8\u597d\uff01\u6709\u4ec0\u4e48\u6211\u53ef\u4ee5\u5e2e\u52a9\u60a8\u7684\u5417\uff1f')"
]
},
"execution_count": 3,
Expand All @@ -133,7 +142,7 @@
{
"data": {
"text/plain": [
"[AIMessage(content='您好!有什么我可以帮助您的吗?')]"
"[AIMessage(content='\u60a8\u597d\uff01\u6709\u4ec0\u4e48\u6211\u53ef\u4ee5\u5e2e\u52a9\u60a8\u7684\u5417\uff1f')]"
]
},
"execution_count": 4,
Expand Down Expand Up @@ -161,7 +170,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"您好!有什么我可以帮助您的吗?\n"
"\u60a8\u597d\uff01\u6709\u4ec0\u4e48\u6211\u53ef\u4ee5\u5e2e\u52a9\u60a8\u7684\u5417\uff1f\n"
]
}
],
Expand Down Expand Up @@ -194,7 +203,7 @@
{
"data": {
"text/plain": [
"AIMessage(content='Hello,可以回答问题了,我会竭尽全力为您解答,请问有什么问题吗?')"
"AIMessage(content='Hello\uff0c\u53ef\u4ee5\u56de\u7b54\u95ee\u9898\u4e86\uff0c\u6211\u4f1a\u7aed\u5c3d\u5168\u529b\u4e3a\u60a8\u89e3\u7b54\uff0c\u8bf7\u95ee\u6709\u4ec0\u4e48\u95ee\u9898\u5417\uff1f')"
]
},
"execution_count": 6,
Expand Down Expand Up @@ -234,7 +243,7 @@
{
"data": {
"text/plain": [
"AIMessage(content='您好!有什么我可以帮助您的吗?')"
"AIMessage(content='\u60a8\u597d\uff01\u6709\u4ec0\u4e48\u6211\u53ef\u4ee5\u5e2e\u52a9\u60a8\u7684\u5417\uff1f')"
]
},
"execution_count": 7,
Expand Down Expand Up @@ -276,4 +285,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
8 changes: 4 additions & 4 deletions docs/docs/integrations/chat/bedrock.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
}
],
"source": [
"%pip install --upgrade --quiet langchain-aws"
"%pip install --upgrade --quiet langchain-aws langchain-community"
]
},
{
Expand Down Expand Up @@ -89,7 +89,7 @@
{
"data": {
"text/plain": [
"AIMessage(content=\"Voici la traduction en français :\\n\\nJ'aime la programmation.\", additional_kwargs={'usage': {'prompt_tokens': 20, 'completion_tokens': 21, 'total_tokens': 41}}, response_metadata={'model_id': 'anthropic.claude-3-sonnet-20240229-v1:0', 'usage': {'prompt_tokens': 20, 'completion_tokens': 21, 'total_tokens': 41}}, id='run-994f0362-0e50-4524-afad-3c4f5bb11328-0')"
"AIMessage(content=\"Voici la traduction en fran\u00e7ais :\\n\\nJ'aime la programmation.\", additional_kwargs={'usage': {'prompt_tokens': 20, 'completion_tokens': 21, 'total_tokens': 41}}, response_metadata={'model_id': 'anthropic.claude-3-sonnet-20240229-v1:0', 'usage': {'prompt_tokens': 20, 'completion_tokens': 21, 'total_tokens': 41}}, id='run-994f0362-0e50-4524-afad-3c4f5bb11328-0')"
]
},
"execution_count": 12,
Expand Down Expand Up @@ -127,7 +127,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Voici la traduction en français :\n",
"Voici la traduction en fran\u00e7ais :\n",
"\n",
"J'aime la programmation."
]
Expand Down Expand Up @@ -231,4 +231,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
4 changes: 2 additions & 2 deletions docs/docs/integrations/chat/cohere.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
{
"data": {
"text/plain": [
"AIMessage(content='What color socks do bears wear?\\n\\nThey don’t wear socks, they have bear feet. \\n\\nHope you laughed! If not, maybe this will help: laughter is the best medicine, and a good sense of humor is infectious!', additional_kwargs={'documents': None, 'citations': None, 'search_results': None, 'search_queries': None, 'is_search_required': None, 'generation_id': '6edccf44-9bc8-4139-b30e-13b368f3563c', 'token_count': {'prompt_tokens': 68, 'response_tokens': 51, 'total_tokens': 119, 'billed_tokens': 108}}, response_metadata={'documents': None, 'citations': None, 'search_results': None, 'search_queries': None, 'is_search_required': None, 'generation_id': '6edccf44-9bc8-4139-b30e-13b368f3563c', 'token_count': {'prompt_tokens': 68, 'response_tokens': 51, 'total_tokens': 119, 'billed_tokens': 108}}, id='run-ef7f9789-0d4d-43bf-a4f7-f2a0e27a5320-0')"
"AIMessage(content='What color socks do bears wear?\\n\\nThey don\u2019t wear socks, they have bear feet. \\n\\nHope you laughed! If not, maybe this will help: laughter is the best medicine, and a good sense of humor is infectious!', additional_kwargs={'documents': None, 'citations': None, 'search_results': None, 'search_queries': None, 'is_search_required': None, 'generation_id': '6edccf44-9bc8-4139-b30e-13b368f3563c', 'token_count': {'prompt_tokens': 68, 'response_tokens': 51, 'total_tokens': 119, 'billed_tokens': 108}}, response_metadata={'documents': None, 'citations': None, 'search_results': None, 'search_queries': None, 'is_search_required': None, 'generation_id': '6edccf44-9bc8-4139-b30e-13b368f3563c', 'token_count': {'prompt_tokens': 68, 'response_tokens': 51, 'total_tokens': 119, 'billed_tokens': 108}}, id='run-ef7f9789-0d4d-43bf-a4f7-f2a0e27a5320-0')"
]
},
"execution_count": 20,
Expand Down Expand Up @@ -260,4 +260,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
25 changes: 17 additions & 8 deletions docs/docs/integrations/chat/coze.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@
"ChatCoze chat models API by coze.com. For more information, see [https://www.coze.com/open/docs/chat](https://www.coze.com/open/docs/chat)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%pip install -qU langchain-community"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand Down Expand Up @@ -86,13 +95,13 @@
{
"data": {
"text/plain": [
"AIMessage(content='为你找到关于coze的信息如下:\n",
"AIMessage(content='\u4e3a\u4f60\u627e\u5230\u5173\u4e8ecoze\u7684\u4fe1\u606f\u5982\u4e0b\uff1a\n",
"\n",
"Coze是一个由字节跳动推出的AI聊天机器人和应用程序编辑开发平台。\n",
"Coze\u662f\u4e00\u4e2a\u7531\u5b57\u8282\u8df3\u52a8\u63a8\u51fa\u7684AI\u804a\u5929\u673a\u5668\u4eba\u548c\u5e94\u7528\u7a0b\u5e8f\u7f16\u8f91\u5f00\u53d1\u5e73\u53f0\u3002\n",
"\n",
"用户无论是否有编程经验,都可以通过该平台快速创建各种类型的聊天机器人、智能体、AI应用和插件,并将其部署在社交平台和即时聊天应用程序中。\n",
"\u7528\u6237\u65e0\u8bba\u662f\u5426\u6709\u7f16\u7a0b\u7ecf\u9a8c\uff0c\u90fd\u53ef\u4ee5\u901a\u8fc7\u8be5\u5e73\u53f0\u5feb\u901f\u521b\u5efa\u5404\u79cd\u7c7b\u578b\u7684\u804a\u5929\u673a\u5668\u4eba\u3001\u667a\u80fd\u4f53\u3001AI\u5e94\u7528\u548c\u63d2\u4ef6\uff0c\u5e76\u5c06\u5176\u90e8\u7f72\u5728\u793e\u4ea4\u5e73\u53f0\u548c\u5373\u65f6\u804a\u5929\u5e94\u7528\u7a0b\u5e8f\u4e2d\u3002\n",
"\n",
"国际版使用的模型比国内版更强大。')"
"\u56fd\u9645\u7248\u4f7f\u7528\u7684\u6a21\u578b\u6bd4\u56fd\u5185\u7248\u66f4\u5f3a\u5927\u3002')"
]
},
"execution_count": 3,
Expand All @@ -101,7 +110,7 @@
}
],
"source": [
"chat([HumanMessage(content=\"什么是扣子(coze)\")])"
"chat([HumanMessage(content=\"\u4ec0\u4e48\u662f\u6263\u5b50(coze)\")])"
]
},
{
Expand Down Expand Up @@ -149,7 +158,7 @@
{
"data": {
"text/plain": [
"AIMessageChunk(content='为你查询到Coze是一个由字节跳动推出的AI聊天机器人和应用程序编辑开发平台。')"
"AIMessageChunk(content='\u4e3a\u4f60\u67e5\u8be2\u5230Coze\u662f\u4e00\u4e2a\u7531\u5b57\u8282\u8df3\u52a8\u63a8\u51fa\u7684AI\u804a\u5929\u673a\u5668\u4eba\u548c\u5e94\u7528\u7a0b\u5e8f\u7f16\u8f91\u5f00\u53d1\u5e73\u53f0\u3002')"
]
},
"execution_count": 6,
Expand All @@ -158,7 +167,7 @@
}
],
"source": [
"chat([HumanMessage(content=\"什么是扣子(coze)\")])"
"chat([HumanMessage(content=\"\u4ec0\u4e48\u662f\u6263\u5b50(coze)\")])"
]
}
],
Expand All @@ -183,4 +192,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
Loading