Skip to content

Commit

Permalink
Merge branch 'master' into docs/sql-lantern
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-yt authored Jan 31, 2024
2 parents 1203b0d + 2e5949b commit 5ee86e4
Show file tree
Hide file tree
Showing 211 changed files with 14,949 additions and 3,002 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ There are many ways to contribute to LangChain. Here are some common ways people

- [**Documentation**](https://python.langchain.com/docs/contributing/documentation): Help improve our docs, including this one!
- [**Code**](https://python.langchain.com/docs/contributing/code): Help us write code, fix bugs, or improve our infrastructure.
- [**Integrations**](https://python.langchain.com/docs/contributing/integration): Help us integrate with your favorite vendors and tools.
- [**Integrations**](https://python.langchain.com/docs/contributing/integrations): Help us integrate with your favorite vendors and tools.

### 🚩GitHub Issues

Expand Down
8 changes: 1 addition & 7 deletions .github/scripts/check_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,7 @@
elif "libs/partners" in file:
partner_dir = file.split("/")[2]
if os.path.isdir(f"libs/partners/{partner_dir}"):
dirs_to_run.update(
(
f"libs/partners/{partner_dir}",
"libs/langchain",
"libs/experimental",
)
)
dirs_to_run.add(f"libs/partners/{partner_dir}")
# Skip if the directory was deleted
elif "libs/langchain" in file:
dirs_to_run.update(("libs/langchain", "libs/experimental"))
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/langchain_cli_release.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/langchain_community_release.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/langchain_core_release.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/langchain_experimental_release.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/langchain_experimental_test_release.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/langchain_openai_release.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/langchain_release.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/langchain_test_release.yml

This file was deleted.

2 changes: 0 additions & 2 deletions cookbook/sql_db_qa.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,6 @@ local_llm = HuggingFacePipeline(pipeline=pipe)
<CodeOutputBlock lang="python">

```
/workspace/langchain/.venv/lib/python3.9/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
from .autonotebook import tqdm as notebook_tqdm
Loading checkpoint shards: 100%|██████████| 8/8 [00:32<00:00, 4.11s/it]
```

Expand Down
2 changes: 1 addition & 1 deletion docs/api_reference/guide_imports.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/docs/get_started/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ A Retriever can be backed by anything - a SQL table, the internet, etc - but in

First, we need to load the data that we want to index. In order to do this, we will use the WebBaseLoader. This requires installing [BeautifulSoup](https://beautiful-soup-4.readthedocs.io/en/latest/):

```
```shell
pip install beautifulsoup4
```
Expand Down
16 changes: 12 additions & 4 deletions docs/docs/integrations/chat/baichuan.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,18 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"or you can set `api_key` in your environment variables\n",
"```bash\n",
"export BAICHUAN_API_KEY=YOUR_API_KEY\n",
"```"
"Alternatively, you can set your API key with:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"\n",
"os.environ[\"BAICHUAN_API_KEY\"] = \"YOUR_API_KEY\""
]
},
{
Expand Down
13 changes: 1 addition & 12 deletions docs/docs/integrations/chat/huggingface.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[33mWARNING: You are using pip version 22.0.4; however, version 23.3.1 is available.\n",
"You should consider upgrading via the '/Users/jacoblee/langchain/langchain/libs/langchain/.venv/bin/python -m pip install --upgrade pip' command.\u001b[0m\u001b[33m\n",
"\u001b[0mNote: you may need to restart the kernel to use updated packages.\n"
]
}
Expand Down Expand Up @@ -56,16 +54,7 @@
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/jacoblee/langchain/langchain/libs/langchain/.venv/lib/python3.10/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from .autonotebook import tqdm as notebook_tqdm\n"
]
}
],
"outputs": [],
"source": [
"import os\n",
"\n",
Expand Down
97 changes: 97 additions & 0 deletions docs/docs/integrations/llms/baichuan.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Baichuan LLM\n",
"Baichuan Inc. (https://www.baichuan-ai.com/) is a Chinese startup in the era of AGI, dedicated to addressing fundamental human needs: Efficiency, Health, and Happiness."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Prerequisite\n",
"An API key is required to access Baichuan LLM API. Visit https://platform.baichuan-ai.com/ to get your API key."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Use Baichuan LLM"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"\n",
"os.environ[\"BAICHUAN_API_KEY\"] = \"YOUR_API_KEY\""
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from langchain_community.llms import BaichuanLLM\n",
"\n",
"# Load the model\n",
"llm = BaichuanLLM()\n",
"\n",
"res = llm(\"What's your name?\")\n",
"print(res)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"res = llm.generate(prompts=[\"你好!\"])\n",
"res"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"for res in llm.stream(\"Who won the second world war?\"):\n",
" print(res)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import asyncio\n",
"\n",
"\n",
"async def run_aio_stream():\n",
" async for res in llm.astream(\"Write a poem about the sun.\"):\n",
" print(res)\n",
"\n",
"\n",
"asyncio.run(run_aio_stream())"
]
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading

0 comments on commit 5ee86e4

Please sign in to comment.