Commit Graph

239 Commits (ec727bf16636abfbb3a371148d21b77c178280df)

Author SHA1 Message Date
Harrison Chase fc0cfd7d1f
docs (#848) 2 years ago
Harrison Chase 23d5f64bda
Harrison/ngram example (#846)
Co-authored-by: Sean Spriggens <ssprigge@syr.edu>
2 years ago
Harrison Chase 0de55048b7
return code for pal (#844) 2 years ago
Harrison Chase d564308e0f
rfc: instruct embeddings (#811)
Co-authored-by: seanaedmiston <seane999@gmail.com>
2 years ago
Eli Mernit bfabd1d5c0
Added new deployment template (#835)
This PR introduces a new template for deploying LangChain apps as web
endpoints. It includes template code, and links to a detailed
code-walkthrough.
2 years ago
Istora Mandiri 06438794e1
Fix typo in textsplitter docs (#825) 2 years ago
Harrison Chase b0d560be56
add to gallery (#824) 2 years ago
Harrison Chase 7b4882a2f4
Harrison/tf embeddings (#817)
Co-authored-by: Ryohei Kuroki <10434946+yakigac@users.noreply.github.com>
2 years ago
Harrison Chase 94ae126747
return sql intermediate steps (#792) 2 years ago
Roy Williams 6086292252
Centralize logic for loading from LangChainHub, add ability to pin dependencies (#805)
It's generally considered to be a good practice to pin dependencies to
prevent surprise breakages when a new version of a dependency is
released. This commit adds the ability to pin dependencies when loading
from LangChainHub.

Centralizing this logic and using urllib fixes an issue identified by
some windows users highlighted in this video -
https://youtu.be/aJ6IQUh8MLQ?t=537
2 years ago
Harrison Chase 7728a848d0
Harrison/tracing docs (#806)
Co-authored-by: Ankush Gola <9536492+agola11@users.noreply.github.com>
2 years ago
Harrison Chase f3da4dc6ba
Harrison/tracing docs (#804)
Co-authored-by: Ankush Gola <9536492+agola11@users.noreply.github.com>
2 years ago
Harrison Chase ae1b589f60
Harrison/add link for support (#794) 2 years ago
Harrison Chase 1ad7973cc6
Harrison/tool decorator (#790)
Co-authored-by: Jason Liu <jxnl@users.noreply.github.com>
Co-authored-by: Jason Liu <jason@jxnl.coA>
2 years ago
Harrison Chase 248c297f1b
Sample row in table info for SQLDatabase (#769) (#782)
The agents usually benefit from understanding what the data looks like
to be able to filter effectively. Sending just one row in the table info
allows the agent to understand the data before querying and get better
results.

---------

Co-authored-by: Francisco Ingham <>

---------

Co-authored-by: Francisco Ingham <fpingham@gmail.com>
2 years ago
Harrison Chase c658f0aed3
Harrison/add to search (#778)
Co-authored-by: Enrico Shippole <enricoship@gmail.com>
2 years ago
Harrison Chase a5d003f0c9
update notebook and make backwards compatible (#772) 2 years ago
Harrison Chase b9ad214801
add docs for loading from hub (#763) 2 years ago
Harrison Chase 1b89a438cf
(wip) Harrison/serialize agents (#725) 2 years ago
Roy Williams d2f882158f
Add type information for crawler.py (#738)
Added type information to `crawler.py` to make it safer to use and
understand.
2 years ago
Harrison Chase bd0bf4e0a9
Harrison/generate blog post (#732)
Co-authored-by: Ren <yirenlu92@users.noreply.github.com>
2 years ago
scadEfUr e3df8ab6dc
move hyde into chains (#728)
Co-authored-by: scadEfUr <>
2 years ago
Harrison Chase 0ffeabd14f
Harrison/serialize llm chain (#671) 2 years ago
Sam Hogan 499e54edda
fix typos in readme and text splitter docs (#720)
Fix typos in readme and TextSplitter documentation.
2 years ago
Николай Шангин 18b1466893
Fix not imported 'validator' (#715)
otherwise `@validator("input_variables")` do not work
2 years ago
Harrison Chase b69b551c8b
clarify use cases (#711) 2 years ago
Nicolas 66fd57878a
docs: Update vector_db_qa_with_sources.ipynb (#706) 2 years ago
Harrison Chase fc4ad2db0f
langchain hub docs (#704)
Co-authored-by: scadEfUr <123224380+scadEfUr@users.noreply.github.com>
2 years ago
Harrison Chase 3a30e6daa8
Harrison/openai callback (#684) 2 years ago
Amos Ng 8baf6fb920
Update examples to fix execution problems (#685)
On the [Getting Started
page](https://langchain.readthedocs.io/en/latest/modules/prompts/getting_started.html)
for prompt templates, I believe the very last example

```python
print(dynamic_prompt.format(adjective=long_string))
```

should actually be

```python
print(dynamic_prompt.format(input=long_string))
```

The existing example produces `KeyError: 'input'` as expected

***

On the [Create a custom prompt
template](https://langchain.readthedocs.io/en/latest/modules/prompts/examples/custom_prompt_template.html#id1)
page, I believe the line

```python
Function Name: {kwargs["function_name"]}
```

should actually be

```python
Function Name: {kwargs["function_name"].__name__}
```

The existing example produces the prompt:

```
        Given the function name and source code, generate an English language explanation of the function.
        Function Name: <function get_source_code at 0x7f907bc0e0e0>
        Source Code:
        def get_source_code(function_name):
    # Get the source code of the function
    return inspect.getsource(function_name)

        Explanation:
```

***

On the [Example
Selectors](https://langchain.readthedocs.io/en/latest/modules/prompts/examples/example_selectors.html)
page, the first example does not define `example_prompt`, which is also
subtly different from previous example prompts used. For user
convenience, I suggest including

```python
example_prompt = PromptTemplate(
    input_variables=["input", "output"],
    template="Input: {input}\nOutput: {output}",
)
```

in the code to be copy-pasted
2 years ago
Nicolas 4ddfa82bb7
docs: small typo on serpapi.md (#693) 2 years ago
Nicolas 34cb8850e9
docs: small typo google_search.md (#692) 2 years ago
Samantha Whitmore 77e3d58922
ConversationEntityMemory: Chain which uses an entity extraction & sum… (#678)
…marization prompt to maintain a key-value store of memory information

cc @devennavani

Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
2 years ago
Ikko Eltociear Ashimine 64580259d0
Fix typo in hyde.ipynb (#688)
therefor -> therefore
2 years ago
Harrison Chase e45f7e40e8
Harrison/few shot yaml (#682)
Co-authored-by: vintro <77507980+vintrocode@users.noreply.github.com>
2 years ago
Will Olson 2f57d18b25
Update hyperlink in Custom Prompt Template page (#677)
The current link points to a non-existent page. I've updated the link to
match what is on the "Create a custom example selector" page.

<img width="584" alt="Screen Shot 2023-01-21 at 10 33 05 AM"
src="https://user-images.githubusercontent.com/6773706/213879535-d8f2953d-ac37-448d-9b32-fdeb7b73cc32.png">
2 years ago
Harrison Chase 3d41af0aba
Harrison/load tools kwargs (#681)
Co-authored-by: Bruno Bornsztein <bruno.bornsztein@gmail.com>
2 years ago
Harrison Chase 0b204d8c21
Harrison/quadrant (#665)
Co-authored-by: Kacper Łukawski <kacperlukawski@users.noreply.github.com>
2 years ago
Harrison Chase d0fdc6da11
Harrison/bing wrapper (#656)
Co-authored-by: Enrico Shippole <henryshippole@gmail.com>
2 years ago
Charles Frye bfb23f4608
typo bugfixes in getting started with prompts (#651)
tl;dr: input -> word, output -> antonym, rename to dynamic_prompt
consistently

The provided code in this example doesn't run, because the keys are
`word` and `antonym`, rather than `input` and `output`.

Also, the `ExampleSelector`-based prompt is named `few_shot_prompt` when
defined and `dynamic_prompt` in the follow-up example. The former name
is less descriptive and collides with an earlier example, so I opted for
the latter.

Thanks for making a really cool library!
2 years ago
John 3adc5227cd
typo (#650) 2 years ago
Harrison Chase 30abfc41c2
add instructions for saving loading (#642) 2 years ago
Harrison Chase 95720adff5
Add documentation for custom prompts for Agents (#631) (#640)
- Added a comment interpreting regex for `ZeroShotAgent`
- Added a note to the `Custom Agent` notebook

Co-authored-by: Sam Ching <samuel@duolingo.com>
2 years ago
Harrison Chase 6be5f4e4c4
Harrison/sql db chain (#641)
Co-authored-by: Bruno Bornsztein <bruno.bornsztein@gmail.com>
2 years ago
Chetanya Rastogi b550f57912
Fix the env variable for OpenAI Base Url (#639)
For using Azure OpenAI API, we need to set multiple env vars. But as can
be seen in openai package
[here](48b69293a3/openai/__init__.py (L35)),
the env var for setting base url is named `OPENAI_API_BASE` and not
`OPENAI_API_BASE_URL`. This PR fixes that part in the documentation.
2 years ago
Francis b374d481c8
fix typo (#636)
there is a small typo in one of the docs.
2 years ago
Harrison Chase 3d43906572
Harrison/new api chain (#623)
Co-authored-by: Francisco Ingham <fpingham@gmail.com>
Co-authored-by: lesscomfortable <pancho_ingham@hotmail.com>
2 years ago
Harrison Chase 1c71fadfdc
more complex sql chain (#619)
add a more complex sql chain that first subsets the necessary tables
2 years ago
Harrison Chase 2a54e73fec
bump version to 0063 (#616) 2 years ago
Harrison Chase 57bbc5d6da
improve css (#615) 2 years ago
Nicolas 91d7fd20ae
feat: add custom prompt for QAEvalChain chain (#610)
I originally had only modified the `from_llm` to include the prompt but
I realized that if the prompt keys used on the custom prompt didn't
match the default prompt, it wouldn't work because of how `apply` works.

So I made some changes to the evaluate method to check if the prompt is
the default and if not, it will check if the input keys are the same as
the prompt key and update the inputs appropriately.

Let me know if there is a better way to do this.

Also added the custom prompt to the QA eval notebook.
2 years ago
Francisco Ingham 1787c473b8
Custom prompt option for llm_bash and api chains (#612)
Co-authored-by: lesscomfortable <pancho_ingham@hotmail.com>
2 years ago
Nicolas b7225fd010
docs: fix small typo (#611) 2 years ago
Harrison Chase 9f9afbb6a8
add custom prompt for LLMMathChain and SQLDatabase chain (#605) 2 years ago
Sasmitha Manathunga 3e55f1474e
docs: fix typo (#604) 2 years ago
Sam Ching c4c6bf6e6e
Add subsection for colab notebooks (#599)
Motivation is that these don't get lost in the Twitterverse!
2 years ago
Rukmal Weerawarana 0f544a8811
Fix minor error in LLM documentation (#602) 2 years ago
Ikko Eltociear Ashimine 60dfe58325
Fix typo in vector_db_qa.ipynb (#597)
paramter -> parameter
2 years ago
Harrison Chase 950a81399a
bump version to 61 (#596) 2 years ago
Harrison Chase d574bf0a27
add documentation on how to load different chain types (#595) 2 years ago
Harrison Chase 956416c150
Harrison/update links1 (#594)
update links to be relative

Co-authored-by: Marc Green <marcgreen@users.noreply.github.com>
2 years ago
Harrison Chase 8ab09c18a1
Return source documents option in VectorDBQA (#585) (#592)
Co-authored-by: lesscomfortable <pancho_ingham@hotmail.com>

Co-authored-by: Francisco Ingham <fpingham@gmail.com>
Co-authored-by: lesscomfortable <pancho_ingham@hotmail.com>
2 years ago
Harrison Chase 7b6e7f6e12
bump to version 60 (#583) 2 years ago
Harrison Chase f74ce7a104
Harrison/combine memories (#582)
Signed-off-by: Diwank Singh Tomer <diwank.singh@gmail.com>
Co-authored-by: Diwank Singh Tomer <diwank.singh@gmail.com>
2 years ago
Harrison Chase ffc7e04d44
Harrison/wolfram alpha (#579)
Co-authored-by: Nicolas <nicolascamara29@gmail.com>
2 years ago
Harrison Chase 94765e7487
more gallery (#577) 2 years ago
Harrison Chase 50a49eff15
gallery updates (#573) 2 years ago
Harrison Chase 6966863d7d
Harrison/deployments (#572) 2 years ago
Harrison Chase 7de5139750
add example selector docs (#564) 2 years ago
Harrison Chase b06a2a6191
improve documentation on how to pass in custom prompts (#561) 2 years ago
Harrison Chase 1192cc0767
smart text splitter (#530)
smart text splitter that iteratively tries different separators until it
works!
2 years ago
Harrison Chase 8dfad874a2
map rerank chain (#516)
add a chain that applies a prompt to all inputs and then returns not
only an answer but scores it

add examples for question answering and question answering with sources
2 years ago
Nicolas 948eee9fe1
Docs: side menu to match the order (llms) (#557)
Small quick fix:

Suggest making the order of the menu the same as it is written on the
page (Getting Started -> Key Concepts). Before the menu order was not
the same as it was on the page. Not sure if this is the only place the
menu is affected.

Mismatch is found here:
https://langchain.readthedocs.io/en/latest/modules/llms.html
2 years ago
Harrison Chase 823a44ef80
bump to 0058 (#556) 2 years ago
Harrison Chase 74932f2516
RFC: conversational agent (#464)
Co-authored-by: Bruno Bornsztein <bruno.bornsztein@gmail.com>
2 years ago
Harrison Chase e64ed7b975
Harrison/tools priority (#554)
Co-authored-by: Yong723 <50616781+Yongtae723@users.noreply.github.com>
2 years ago
Harrison Chase 4974f49bb7
add return_direct flag to tool (#537)
adds a return_direct flag to tools, which just returns the tool output
as the final output
2 years ago
Harrison Chase 9753bccc71
Feature: linkcheck-action (#534) (#542)
- Add support for local build and linkchecking of docs
- Add GitHub Action to automatically check links before prior to
publication
- Minor reformat of Contributing readme
- Fix existing broken links

Co-authored-by: Hunter Gerlach <hunter@huntergerlach.com>

Co-authored-by: Hunter Gerlach <HunterGerlach@users.noreply.github.com>
Co-authored-by: Hunter Gerlach <hunter@huntergerlach.com>
2 years ago
Harrison Chase 73f7ebd9d1
Harrison/sqlalchemy cache store (#536)
Co-authored-by: Jason Gill <jasongill@gmail.com>
2 years ago
Rubens Mau 020e73017b
Updated embeddings.ipynb (#531)
updated embeddings.ipynb
2 years ago
Ikko Eltociear Ashimine ca9aaac36e
Fix typo in key_concepts.md (#535)
therefor -> therefore
2 years ago
Harrison Chase 9e04c34e20
Add BaseCallbackHandler and CallbackManager (#478)
Co-authored-by: Ankush Gola <9536492+agola11@users.noreply.github.com>
2 years ago
Nuno Campos 6d78be0c83
Add link to gihub repo in header of new docs (#524) 2 years ago
Harrison Chase 0db05b6725
Harrison/add human prefix (#520)
Co-authored-by: Andrew Huang <jhuang16888@gmail.com>
2 years ago
Harrison Chase 03f185bcd5
more robust handling for max iterations (#514)
add a `generate` method which makes one final forward pass through the
llm
2 years ago
Harrison Chase 40326c698c
unify argument name (#513)
unify names in map reduce and refine chains to just be
return_intermediate_steps

also unify the return key
2 years ago
lewtun 12108104c9
Add links to Hugging Face Hub docs (#518)
This PR adds some tweaks to the Hugging Face docs, mostly with links to
the Hub + relevant docs.
2 years ago
Harrison Chase 3efec55f93
update lobby link (#517) 2 years ago
Hunter Gerlach 7253fada0d
Fix/broken getting started link (#511)
I noticed (after publication) that the getting_started link on the main
page was borked. This should fix it.

Co-authored-by: Hunter Gerlach <hunter@huntergerlach.com>
2 years ago
Harrison Chase 985496f4be
Docs refactor (#480)
Big docs refactor! Motivation is to make it easier for people to find
resources they are looking for. To accomplish this, there are now three
main sections:

- Getting Started: steps for getting started, walking through most core
functionality
- Modules: these are different modules of functionality that langchain
provides. Each part here has a "getting started", "how to", "key
concepts" and "reference" section (except in a few select cases where it
didnt easily fit).
- Use Cases: this is to separate use cases (like summarization, question
answering, evaluation, etc) from the modules, and provide a different
entry point to the code base.

There is also a full reference section, as well as extra resources
(glossary, gallery, etc)

Co-authored-by: Shreya Rajpal <ShreyaR@users.noreply.github.com>
2 years ago
Harrison Chase d95b39d37f
version 0.0.53 (#497) 2 years ago
Harrison Chase 0072686aab
Harrison/new search engine (#477)
Co-authored-by: Nicolas <nicolascamara29@gmail.com>
2 years ago
Shuchang Zhou 12aa43469f
Update prompt_management.ipynb (#484) 2 years ago
Harrison Chase d0f194de73
add logic for agent stopping (#420) 2 years ago
Harrison Chase 2b84e5cda3
Harrison/fix memory and serp (#457)
Co-authored-by: Bruno Bornsztein <bruno.bornsztein@gmail.com>
2 years ago
Harrison Chase d98607408b
Harrison/v0050 (#452) 2 years ago
Harrison Chase 55007e71be
add output key for memory (#443)
this allows chains that return multiple values to use memory
2 years ago
Harrison Chase 5208bb8c36
make tools editable (#445)
use dataclass instead of namedtuple, which makes it editable

add example in notebook
2 years ago
Harrison Chase 90e8ccc898
Harrison/update links (#450)
Co-authored-by: Sam Ching <samuelcwl@gmail.com>
Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
2 years ago
Harrison Chase 0c5d3fd894
version 0.0.49 (#436) 2 years ago