Skip to content

Commit

Permalink
Fix poetry.lock
Browse files Browse the repository at this point in the history
  • Loading branch information
pprados committed Jun 2, 2023
1 parent 767afc9 commit 6acba43
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 96 deletions.
50 changes: 43 additions & 7 deletions docs/modules/agents/tools/examples/human_tools.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,20 @@
"Action: Human\n",
"Action Input: \"What is Eric's surname?\"\u001b[0m\n",
"\n",
"What is Eric's surname?\n",
" Zhu\n",
"What is Eric's surname?\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
" Zhu\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Observation: \u001b[36;1m\u001b[1;3mZhu\u001b[0m\n",
"Thought:\u001b[32;1m\u001b[1;3mI now know Eric's surname is Zhu.\n",
Expand Down Expand Up @@ -180,11 +192,23 @@
"Action Input: \"Can you help me attribute a quote?\"\u001b[0m\n",
"\n",
"Can you help me attribute a quote?\n",
"Insert your text. Enter 'q' or press Ctrl-D (or Ctrl-Z on Windows) to end.\n",
"Insert your text. Enter 'q' or press Ctrl-D (or Ctrl-Z on Windows) to end.\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
" vini\n",
" vidi\n",
" vici\n",
" q\n",
" q\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Observation: \u001b[36;1m\u001b[1;3mvini\n",
"vidi\n",
Expand All @@ -194,9 +218,21 @@
"Action Input: \"The quote is 'Veni, vidi, vici'\"\u001b[0m\n",
"\n",
"The quote is 'Veni, vidi, vici'\n",
"Insert your text. Enter 'q' or press Ctrl-D (or Ctrl-Z on Windows) to end.\n",
"Insert your text. Enter 'q' or press Ctrl-D (or Ctrl-Z on Windows) to end.\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
" oh who said it \n",
" q\n",
" q\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Observation: \u001b[36;1m\u001b[1;3moh who said it \u001b[0m\n",
"Thought:\u001b[32;1m\u001b[1;3mI can use DuckDuckGo Search to find out who said the quote\n",
Expand Down Expand Up @@ -248,7 +284,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.9"
"version": "3.11.2"
}
},
"nbformat": 4,
Expand Down
107 changes: 20 additions & 87 deletions docs/modules/chains/generic/router.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,27 +103,6 @@
"default_chain = ConversationChain(llm=llm, output_key=\"text\")"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "fee445ec",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"dict_keys(['physics', 'math'])"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"destination_chains.keys()"
]
},
{
"cell_type": "markdown",
"id": "83cea2d5",
Expand All @@ -136,7 +115,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 6,
"id": "60142895",
"metadata": {},
"outputs": [],
Expand All @@ -147,7 +126,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 7,
"id": "60769f96",
"metadata": {},
"outputs": [],
Expand All @@ -167,28 +146,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"id": "c705b920",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"dict_keys(['physics', 'math'])"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"destination_chains.keys()"
]
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 8,
"id": "db679975",
"metadata": {},
"outputs": [],
Expand All @@ -198,7 +156,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 9,
"id": "90fd594c",
"metadata": {},
"outputs": [
Expand All @@ -213,7 +171,7 @@
"\u001b[1m> Finished chain.\u001b[0m\n",
"\n",
"\n",
"Black body radiation is the electromagnetic radiation emitted from an idealized physical body that absorbs all radiation incident upon it. The spectral radiance of a black body is dependent on its temperature and is described by Planck's law. The higher the temperature of the black body, the higher the energy of the radiation emitted.\n"
"Black body radiation is the term used to describe the electromagnetic radiation emitted by a “black body”—an object that absorbs all radiation incident upon it. A black body is an idealized physical body that absorbs all incident electromagnetic radiation, regardless of frequency or angle of incidence. It does not reflect, emit or transmit energy. This type of radiation is the result of the thermal motion of the body's atoms and molecules, and it is emitted at all wavelengths. The spectrum of radiation emitted is described by Planck's law and is known as the black body spectrum.\n"
]
}
],
Expand All @@ -223,7 +181,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 10,
"id": "b8c83765",
"metadata": {},
"outputs": [
Expand All @@ -238,7 +196,7 @@
"\u001b[1m> Finished chain.\u001b[0m\n",
"?\n",
"\n",
"Answer: 43. The first prime number greater than 40 is 43, and one plus 43 is 44, which is divisible by 3.\n"
"The answer is 43. One plus 43 is 44 which is divisible by 3.\n"
]
}
],
Expand All @@ -248,7 +206,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 11,
"id": "74c6bba7",
"metadata": {},
"outputs": [
Expand All @@ -261,7 +219,7 @@
"\u001b[1m> Entering new MultiPromptChain chain...\u001b[0m\n",
"None: {'input': 'What is the name of the type of cloud that rains?'}\n",
"\u001b[1m> Finished chain.\u001b[0m\n",
" The name of the type of cloud that rains is a cumulonimbus cloud. It is a dark, dense, vertically developed cloud that can produce heavy rain, hail, thunder, lightning, and sometimes even tornadoes.\n"
" The type of cloud that rains is called a cumulonimbus cloud. It is a tall and dense cloud that is often accompanied by thunder and lightning.\n"
]
}
],
Expand All @@ -281,7 +239,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 6,
"id": "55c3ed0e",
"metadata": {},
"outputs": [],
Expand All @@ -293,7 +251,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 7,
"id": "572a5082",
"metadata": {},
"outputs": [],
Expand All @@ -306,51 +264,27 @@
},
{
"cell_type": "code",
"execution_count": 20,
"id": "3212715d",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"os.environ[\"COHERE_API_KEY\"]=\"10e22ce6-8cc6-40a5-b2df-b07ad2c179f6\""
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "5965943a",
"metadata": {},
"outputs": [],
"source": [
"from langchain.embeddings import HuggingFaceEmbeddings"
]
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 11,
"id": "50221efe",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/pprados/workspace.bda/propaleur/.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",
"/home/pprados/workspace.bda/propaleur/.venv/lib/python3.10/site-packages/torch/cuda/__init__.py:107: UserWarning: CUDA initialization: CUDA unknown error - this may be due to an incorrectly set up environment, e.g. changing env variable CUDA_VISIBLE_DEVICES after program start. Setting the available devices to be zero. (Triggered internally at ../c10/cuda/CUDAFunctions.cpp:109.)\n",
" return torch._C._cuda_getDeviceCount() > 0\n"
"Using embedded DuckDB without persistence: data will be transient\n"
]
}
],
"source": [
"router_chain = EmbeddingRouterChain.from_names_and_descriptions(\n",
" names_and_descriptions, Chroma, HuggingFaceEmbeddings(), routing_keys=[\"input\"]\n",
" names_and_descriptions, Chroma, CohereEmbeddings(), routing_keys=[\"input\"]\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 12,
"id": "ff7996a0",
"metadata": {},
"outputs": [],
Expand All @@ -360,7 +294,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 13,
"id": "99270cc9",
"metadata": {},
"outputs": [
Expand All @@ -375,7 +309,7 @@
"\u001b[1m> Finished chain.\u001b[0m\n",
"\n",
"\n",
"Black body radiation is the electromagnetic radiation emitted from a \"black body\" or perfect absorber of radiation. It is a type of thermal radiation emitted from a surface when it is at a temperature above absolute zero. The spectrum of black body radiation is determined by the temperature of the object, and it is the same for all bodies at the same temperature.\n"
"Black body radiation is the emission of energy from an idealized physical body (known as a black body) that is in thermal equilibrium with its environment. It is emitted in a characteristic pattern of frequencies known as a black-body spectrum, which depends only on the temperature of the body. The study of black body radiation is an important part of astrophysics and atmospheric physics, as the thermal radiation emitted by stars and planets can often be approximated as black body radiation.\n"
]
}
],
Expand All @@ -385,7 +319,7 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 14,
"id": "b5ce6238",
"metadata": {},
"outputs": [
Expand All @@ -400,8 +334,7 @@
"\u001b[1m> Finished chain.\u001b[0m\n",
"?\n",
"\n",
"Answer: 43.\n",
"The first prime number greater than 40 is 43. When 1 is added to 43, the result is 44, which is divisible by 3.\n"
"Answer: The first prime number greater than 40 such that one plus the prime number is divisible by 3 is 43.\n"
]
}
],
Expand Down Expand Up @@ -434,7 +367,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.9"
"version": "3.9.1"
}
},
"nbformat": 4,
Expand Down
3 changes: 2 additions & 1 deletion langchain/agents/load_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
from langchain.tools.wikipedia.tool import WikipediaQueryRun
from langchain.tools.wolfram_alpha.tool import WolframAlphaQueryRun
from langchain.tools.openweathermap.tool import OpenWeatherMapQueryRun
from langchain.utilities import ArxivAPIWrapper, GoogleDriveAPIWrapper
from langchain.utilities.arxiv import ArxivAPIWrapper,
from langchain.utilities.google_drive import GoogleDriveAPIWrapper
from langchain.utilities.bing_search import BingSearchAPIWrapper
from langchain.utilities.duckduckgo_search import DuckDuckGoSearchAPIWrapper
from langchain.utilities.google_search import GoogleSearchAPIWrapper
Expand Down
2 changes: 2 additions & 0 deletions langchain/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ class Document(BaseModel):
class BaseRetriever(ABC):
def lazy_get_relevant_documents(self, query: str) -> Iterator[Document]:
"""Get documents relevant for a query.
The default implement use get_relevant_documents(). It's not lazy
but the subclasses can implements this strategy.
Args:
query: string to find relevant documents for
Expand Down
5 changes: 5 additions & 0 deletions langchain/utilities/google_drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,11 @@ class GoogleDriveUtilities(BaseModel):
supportsAllDrives=False,
).lazy_get_relevant_documents())
```
To debug, use:
```
logging.getLogger("langchain.utilities.google_drive").setLevel(logging.INFO)
```
"""

class Config:
Expand Down
3 changes: 2 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ all = [
"weaviate-client",
"redis",
"google-api-python-client",
"google-auth",
"wolframalpha",
"qdrant-client",
"tensorflow-text",
Expand Down

0 comments on commit 6acba43

Please sign in to comment.