Skip to content

Commit

Permalink
Merge branch 'master' into ssdev
Browse files Browse the repository at this point in the history
* master: (68 commits)
  hotfix (langchain-ai#1742)
  Harrison/move docs (langchain-ai#1741)
  move docs (langchain-ai#1740)
  bump version to 114 (langchain-ai#1739)
  Harrison/latex splitter (langchain-ai#1738)
  Harrison/blackboard loader (langchain-ai#1737)
  docs: add docs link to agent toolkits (langchain-ai#1735)
  fix: agent json parser fails with text in suffix (langchain-ai#1734)
  Harrison/official method (langchain-ai#1728)
  Sagemaker Endpoint LLM (langchain-ai#1686)
  adding new agent types in comments (langchain-ai#1711)
  (OpenAI) Add model_name to LLMResult.llm_output (langchain-ai#1713)
  Fix all the bug in init Tool in docs (langchain-ai#1725)
  Bump duckdb-engine to 0.7.0 (langchain-ai#1726)
  Add HTML document_loader that includes page title metadata (langchain-ai#1720)
  fix async in agent (langchain-ai#1723)
  pydantic/json parsing (langchain-ai#1722)
  Loosen PyYAML dependency (langchain-ai#1698)
  Adding ability to `return_pl_id` to all PromptLayer Models in LangChain (langchain-ai#1699)
  fallback to {} for None metadata from Chroma (langchain-ai#1714)
  ...
  • Loading branch information
bdonkey committed Mar 17, 2023
2 parents 7adbdad + 2f6833d commit a680883
Show file tree
Hide file tree
Showing 153 changed files with 8,545 additions and 505 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,6 @@ dmypy.json

# macOS display setting files
.DS_Store

# asdf tool versions
.tool-versions
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
release = version

html_title = project + " " + version
html_last_updated_fmt = "%b %d, %Y"


# -- General configuration ---------------------------------------------------
Expand All @@ -45,6 +46,7 @@
"sphinx.ext.viewcode",
"sphinxcontrib.autodoc_pydantic",
"myst_nb",
"sphinx_copybutton",
"sphinx_panels",
"IPython.sphinxext.ipython_console_highlighting",
]
Expand Down
3 changes: 2 additions & 1 deletion docs/ecosystem/google_serper.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ search = GoogleSerperAPIWrapper()
tools = [
Tool(
name="Intermediate Answer",
func=search.run
func=search.run,
description="useful for when you need to ask with search"
)
]

Expand Down
29 changes: 29 additions & 0 deletions docs/ecosystem/pgvector.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# PGVector

This page covers how to use the Postgres [PGVector](https://github.com/pgvector/pgvector) ecosystem within LangChain
It is broken into two parts: installation and setup, and then references to specific PGVector wrappers.

## Installation
- Install the Python package with `pip install pgvector`


## Setup
1. The first step is to create a database with the `pgvector` extension installed.

Follow the steps at [PGVector Installation Steps](https://github.com/pgvector/pgvector#installation) to install the database and the extension. The docker image is the easiest way to get started.

## Wrappers

### VectorStore

There exists a wrapper around Postgres vector databases, allowing you to use it as a vectorstore,
whether for semantic search or example selection.

To import this vectorstore:
```python
from langchain.vectorstores.pgvector import PGVector
```

### Usage

For a more detailed walkthrough of the PGVector Wrapper, see [this notebook](../modules/indexes/vectorstore_examples/pgvector.ipynb)
18 changes: 17 additions & 1 deletion docs/ecosystem/promptlayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,25 @@ from langchain.llms import PromptLayerOpenAI
llm = PromptLayerOpenAI(pl_tags=["langchain-requests", "chatbot"])
```

To get the PromptLayer request id, use the argument `return_pl_id` when instanializing the LLM
```python
from langchain.llms import PromptLayerOpenAI
llm = PromptLayerOpenAI(return_pl_id=True)
```
This will add the PromptLayer request ID in the `generation_info` field of the `Generation` returned when using `.generate` or `.agenerate`

For example:
```python
llm_results = llm.generate(["hello world"])
for res in llm_results.generations:
print("pl request id: ", res[0].generation_info["pl_request_id"])
```
You can use the PromptLayer request ID to add a prompt, score, or other metadata to your request. [Read more about it here](https://magniv.notion.site/Track-4deee1b1f7a34c1680d085f82567dab9).

This LLM is identical to the [OpenAI LLM](./openai), except that
- all your requests will be logged to your PromptLayer account
- you can add `pl_tags` when instantializing to tag your requests on PromptLayer
- you can add `return_pl_id` when instantializing to return a PromptLayer request id to use [while tracking requests](https://magniv.notion.site/Track-4deee1b1f7a34c1680d085f82567dab9).


PromptLayer also provides native wrappers for [`PromptLayerChatOpenAI`](../modules/chat/examples/promptlayer_chat_openai.ipynb)
PromptLayer also provides native wrappers for [`PromptLayerChatOpenAI`](../modules/chat/examples/promptlayer_chat_openai.ipynb) and `PromptLayerOpenAIChat`
5 changes: 4 additions & 1 deletion docs/ecosystem/unstructured.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ This page is broken into two parts: installation and setup, and then references
- `poppler-utils`
- `tesseract-ocr`
- `libreoffice`
- If you are parsing PDFs, run the following to install the `detectron2` model, which
- If you are parsing PDFs using the `"hi_res"` strategy, run the following to install the `detectron2` model, which
`unstructured` uses for layout detection:
- `pip install "detectron2@git+https://github.com/facebookresearch/detectron2.git@v0.6#egg=detectron2"`
- If `detectron2` is not installed, `unstructured` will fallback to processing PDFs
using the `"fast"` strategy, which uses `pdfminer` directly and doesn't require
`detectron2`.

## Wrappers

Expand Down
9 changes: 9 additions & 0 deletions docs/gallery.rst
Original file line number Diff line number Diff line change
Expand Up @@ -322,5 +322,14 @@ Proprietary

By Zahid Khawaja, this demo utilizes question answering to answer questions about a given website. A followup added this for `YouTube videos <https://twitter.com/chillzaza_/status/1593739682013220865?s=20&t=EhU8jl0KyCPJ7vE9Rnz-cQ>`_, and then another followup added it for `Wikipedia <https://twitter.com/chillzaza_/status/1594847151238037505?s=20&t=EhU8jl0KyCPJ7vE9Rnz-cQ>`_.

---

.. link-button:: https://mynd.so
:type: url
:text: Mynd
:classes: stretched-link btn-lg

+++

A journaling app for self-care that uses AI to uncover insights and patterns over time.

2 changes: 1 addition & 1 deletion docs/modules/agents/agent_toolkits/vectorstore.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"id": "f4814175-964d-42f1-aa9d-22801ce1e912",
"metadata": {},
"source": [
"## Initalize Toolkit and Agent\n",
"## Initialize Toolkit and Agent\n",
"\n",
"First, we'll create an agent with a single vectorstore."
]
Expand Down
Loading

0 comments on commit a680883

Please sign in to comment.