Commit Graph

318 Commits (main)

Author SHA1 Message Date
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
1 year 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
1 year ago
Harrison Chase 823a44ef80
bump to 0058 (#556) 1 year ago
Harrison Chase 74932f2516
RFC: conversational agent (#464)
Co-authored-by: Bruno Bornsztein <bruno.bornsztein@gmail.com>
1 year ago
Harrison Chase e64ed7b975
Harrison/tools priority (#554)
Co-authored-by: Yong723 <50616781+Yongtae723@users.noreply.github.com>
1 year 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
1 year 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>
1 year ago
Harrison Chase 73f7ebd9d1
Harrison/sqlalchemy cache store (#536)
Co-authored-by: Jason Gill <jasongill@gmail.com>
1 year ago
Rubens Mau 020e73017b
Updated embeddings.ipynb (#531)
updated embeddings.ipynb
1 year ago
Ikko Eltociear Ashimine ca9aaac36e
Fix typo in key_concepts.md (#535)
therefor -> therefore
1 year ago
Harrison Chase 9e04c34e20
Add BaseCallbackHandler and CallbackManager (#478)
Co-authored-by: Ankush Gola <9536492+agola11@users.noreply.github.com>
1 year ago
Nuno Campos 6d78be0c83
Add link to gihub repo in header of new docs (#524) 1 year ago
Harrison Chase 0db05b6725
Harrison/add human prefix (#520)
Co-authored-by: Andrew Huang <jhuang16888@gmail.com>
1 year ago
Harrison Chase 03f185bcd5
more robust handling for max iterations (#514)
add a `generate` method which makes one final forward pass through the
llm
1 year 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
1 year 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.
1 year ago
Harrison Chase 3efec55f93
update lobby link (#517) 1 year 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>
1 year 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>
1 year ago
Harrison Chase d95b39d37f
version 0.0.53 (#497) 1 year ago
Harrison Chase 0072686aab
Harrison/new search engine (#477)
Co-authored-by: Nicolas <nicolascamara29@gmail.com>
1 year ago
Shuchang Zhou 12aa43469f
Update prompt_management.ipynb (#484) 1 year ago
Harrison Chase d0f194de73
add logic for agent stopping (#420) 1 year ago
Harrison Chase 2b84e5cda3
Harrison/fix memory and serp (#457)
Co-authored-by: Bruno Bornsztein <bruno.bornsztein@gmail.com>
1 year ago
Harrison Chase d98607408b
Harrison/v0050 (#452) 1 year ago
Harrison Chase 55007e71be
add output key for memory (#443)
this allows chains that return multiple values to use memory
1 year ago
Harrison Chase 5208bb8c36
make tools editable (#445)
use dataclass instead of namedtuple, which makes it editable

add example in notebook
1 year ago
Harrison Chase 90e8ccc898
Harrison/update links (#450)
Co-authored-by: Sam Ching <samuelcwl@gmail.com>
Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
1 year ago
Harrison Chase 0c5d3fd894
version 0.0.49 (#436) 1 year ago
Harrison Chase b7566b5ec3
Harrison/return intermediate steps (#428) 1 year ago
Harrison Chase 7fc4b4b3e1
Harrison/ver 0048 (#429) 1 year ago
Harrison Chase b50a56830d
Harrison/evaluation notebook (#426) 1 year ago
Harrison Chase 97f4000d3a
fix react docstore (#427) 1 year ago
Ikko Ashimine 9ae1d75318
Update integrations.md (#424)
HuggingFace -> Hugging Face
1 year ago
Harrison Chase 0d7aa1ee99
Harrison/docs to index (#419)
Add method for going directly from documents to VectorStores

Update notebook to showcase this functionality
1 year ago
Harrison Chase 48ae981d69
Harrison/multi input tools (#421)
add documentation on how to use tools that require multiple inputs
1 year ago
Andrew Wang 4416dc9d5d
Update prompt_serialization.ipynb (#417)
Fix typo.
Originally "support methods are..."
Now "support methods *that* are.."
1 year ago
Harrison Chase 20959d8c36
check memory variables (#411)
can have multiple input keys, if some come from memory
1 year ago
altryne f990395211
Readme typos (#409)
I was honored by the twitter mention, so used PyCharm to try and... help
docs even a little bit.
Mostly typo-s and correct spellings. 

PyCharm really complains about "really good" being used all the time and
recommended alternative wordings haha
1 year ago
Dheeraj Agrawal ea3da9a469
Fix documentation error langchain explanation of combine_docs.md (#404)
This PR is regarding the issue here -
https://github.com/hwchase17/langchain/issues/403
1 year ago
Harrison Chase 77e1743341
update example (#402) 1 year ago
Samantha Whitmore 6bc8ae63ef
Add Redis cache implementation (#397)
I'm using a hash function for the key just to make sure its length
doesn't get out of hand, otherwise the implementation is quite similar.
1 year ago
Harrison Chase ff03242fa0
Harrison/ver 044 (#400) 1 year ago
Harrison Chase 6b60c509ac
(WIP) add HyDE (#393)
Co-authored-by: cameronccohen <cameron.c.cohen@gmail.com>
Co-authored-by: Cameron Cohen <cameron.cohen@quantco.com>
1 year ago
Keiji Kanazawa 543db9c2df
Add Azure OpenAI LLM (#395)
Hi!  This PR adds support for the Azure OpenAI service to LangChain.

I've tried to follow the contributing guidelines.

Co-authored-by: Keiji Kanazawa <{ID}+{username}@users.noreply.github.com>
1 year ago
Harrison Chase c104d507bf
Harrison/improve data augmented generation docs (#390)
Co-authored-by: cameronccohen <cameron.c.cohen@gmail.com>
Co-authored-by: Cameron Cohen <cameron.cohen@quantco.com>
1 year ago
Harrison Chase ad4414b59f
update docs (#389) 1 year ago
Harrison Chase c8b4b54479
bump version to 0.0.42 (#388) 1 year ago
Harrison Chase 47ba34c83a
split up and improve agent docs (#387) 1 year ago
Abi Raja 467aa0cee0
Fix typo in docs (#386) 1 year ago
Harrison Chase 6be5747466
RFC: add cache override to LLM class (#379) 1 year ago
Harrison Chase 46c428234f
MMR example selector (#377)
implement max marginal relevance example selector
1 year ago
Harrison Chase ffed5e0056
Harrison/jinja formatter (#385)
Co-authored-by: Benjamin <BenderV@users.noreply.github.com>
1 year ago
Harrison Chase a01d3e6955
fix agent memory docs (#382) 1 year ago
Harrison Chase cf98f219f9
Harrison/tools exp (#372) 1 year ago
Harrison Chase 2eef76ed3f
fix documentation (#365) 1 year ago
Benjamin 85c1bd2cd0
add sqlalchemy generic cache (#361)
Created a generic SQLAlchemyCache class to plug any database supported
by SQAlchemy. (I am using Postgres).
I also based the class SQLiteCache class on this class SQLAlchemyCache.

As a side note, I'm questioning the need for two distinct class
LLMCache, FullLLMCache. Shouldn't we merge both ?
1 year ago
Harrison Chase 809a9f485f
Harrison/new version (#362) 1 year ago
Harrison Chase 2dd895d98c
add openai tokenizer (#355) 1 year ago
Harrison Chase c1b50b7b13
Harrison/map reduce merge (#344)
Co-authored-by: John Nay <JohnNay@users.noreply.github.com>
1 year ago
Harrison Chase 78b31e5966
Harrison/cache (#343) 1 year ago
Harrison Chase 5161ae7e08
add new example (#345) 1 year ago
Harrison Chase e26b6f9c89
fix batching (#339) 1 year ago
Harrison Chase 996b5a3dfb
Harrison/llm final stuff (#332) 1 year ago
Ankush Gola 8fdcdf4c2f
add .idea files to gitignore, add zsh note to installation docs (#329) 1 year ago
Harrison Chase e02d6b2288
beta: logger (#307) 1 year ago
Harrison Chase 36b4c58acf
expose more stuff (#306) 1 year ago
Hunter Gerlach 9ee6115deb
Minor grammar fixes for memory docs to improve readability (#303)
Nothing of substance was changed. I simply corrected a few minor errors
that could slow down the reader.

Co-authored-by: Hunter Gerlach <hunter@huntergerlach.com>
1 year ago
Harrison Chase 9d08384d5f
Harrison/bump version (#300) 1 year ago
Harrison Chase 853894dd47
add moderation chain (#299) 1 year ago
andersenchen 5267ebce2d
Add LLMCheckerChain (#281)
Implementation of https://github.com/jagilley/fact-checker. Works pretty
well.

<img width="993" alt="Screenshot 2022-12-07 at 4 41 47 PM"
src="https://user-images.githubusercontent.com/101075607/206302751-356a19ff-d000-4798-9aee-9c38b7f532b9.png">

Verifying this manually:
1. "Only two kinds of egg-laying mammals are left on the planet
today—the duck-billed platypus and the echidna, or spiny anteater."
https://www.scientificamerican.com/article/extreme-monotremes/
2. "An [Echidna] egg weighs 1.5 to 2 grams (0.05 to 0.07
oz)[[19]](https://en.wikipedia.org/wiki/Echidna#cite_note-19) and is
about 1.4 centimetres (0.55 in) long."
https://en.wikipedia.org/wiki/Echidna#:~:text=sleep%20is%20suppressed.-,Reproduction,a%20reptile%2Dlike%20egg%20tooth.
3. "A [platypus] lays one to three (usually two) small, leathery eggs
(similar to those of reptiles), about 11 mm (7⁄16 in) in diameter and
slightly rounder than bird eggs."
https://en.wikipedia.org/wiki/Platypus#:~:text=It%20lays%20one%20to%20three,slightly%20rounder%20than%20bird%20eggs.
4. Therefore, an Echidna is the mammal that lays the biggest eggs.


cc @hwchase17
1 year ago
Harrison Chase 43c9bd869f
add memprompt docs (#294) 1 year ago
Ben 0f399350f1
Fix typo in Getting Started / LLM Chains docs (#291)
I noticed this typo when reading the getting started guide, hope this
fix makes sense.
1 year ago
Samantha Whitmore b10be842f6
ChatGPT Clone: adding ConversationBufferWindowMemory to replicate vir… (#288)
…tual env example
1 year ago
Harrison Chase e2e501aa06
Harrison/version 0032 (#283) 1 year ago
Harrison Chase e9b1c8cdfa
Harrison/base combine doc chain (#264) 1 year ago
Harrison Chase c27a6fa8a4
update docs (#278) 1 year ago
Harrison Chase 834b391792
update notebooks (#275) 1 year ago
coyotespike b7bef36ee1
BashChain (#260)
Love the project, a ton of fun!

I think the PR is pretty self-explanatory, happy to make any changes! I
am working on using it in an `LLMBashChain` and may update as that
progresses.

Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
1 year ago
Harrison Chase 28be37f470
LLMRequestsChain (#267) 1 year ago
Harrison Chase 5cd6956d58
Harrison/version 0028 (#259) 1 year ago
Harrison Chase b5d8434a50
Harrison/improve chain docs (#251) 1 year ago
Scott Leibrand b4762dfff0
Refine Olivia Wilde's boyfriend example prompt to work better (#248)
With the original prompt, the chain keeps trying to jump straight to
doing math directly, without first looking up ages. With this two-part
question, it behaves more as intended:


> Entering new ZeroShotAgent chain...
How old is Olivia Wilde's boyfriend? What is that number raised to the
0.23 power?
Thought: I need to find out how old Olivia Wilde's boyfriend is, and
then use a calculator to calculate the power.
Action: Search
Action Input: Olivia Wilde's boyfriend age
Observation: While Wilde, 37, and Styles, 27, have both kept a low
profile when it comes to talking about their relationship, Wilde did
address their ...
Thought: Olivia Wilde's boyfriend is 27 years old.
Action: Calculator
Action Input: 27^0.23

> Entering new LLMMathChain chain...
27^0.23

```python
import math
print(math.pow(27, 0.23))
```

Answer: 2.1340945944237553

> Finished LLMMathChain chain.

Observation: Answer: 2.1340945944237553

Thought: I now know the final answer.
Final Answer: 2.1340945944237553
> Finished ZeroShotAgent chain.
1 year ago
Harrison Chase 024c3e1dbe
add react text world doc (#245) 1 year ago
Harrison Chase 347fc49d4d
Harrison/combine documents chain (#212)
combine documents chain powering vector db qa with sources chain
1 year ago
Harrison Chase 3bda0019ae
Harrison/list of examples (#218) 1 year ago
Harrison Chase ca2394028f
move search to not be a chain (#226) 1 year ago
Harrison Chase b19a73be26
pal chain touch ups (#225)
expose PAL in main entrypoint
1 year ago
Harrison Chase 1b9b8efbc9
pal chain (#207)
from https://arxiv.org/pdf/2211.10435.pdf
1 year ago
Harrison Chase 03c7140228
fix self ask template (#216) 1 year ago
Harrison Chase d4e6b7a692
Harrison/update docs mem (#201) 1 year ago
Harrison Chase 05c5d0b8ee
add custom prompt notebooks (#198) 1 year ago
Harrison Chase fcb9b2ffe5
Harrison/agent memory (#197)
add doc for agent with memory
1 year ago
Harrison Chase 6eab5254e5
add docs for custom agents (#196) 1 year ago
Harrison Chase 08deed9002
Harrison/memory docs (#195)
update memory docs and change variables
1 year ago
Harrison Chase f18a08f58d
add memory to llm chain notebook (#193) 1 year ago
Harrison Chase c3ad99a34f
Harrison/more memory docs (#192) 1 year ago
Harrison Chase b0feb3608b
documentation (#191) 1 year ago
Samantha Whitmore a408ed3ea3
Samantha/add conversation chain (#166)
Add MemoryChain and ConversationChain as chains that take a docstore in
addition to the prompt, and use the docstore to stuff context into the
prompt. This can be used to have an ongoing conversation with a chatbot.

Probably needs a bit of refactoring for code quality

Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
2 years ago
Samantha Whitmore 09f301cd38
Add add_example method to all ExampleSelector classes, with tests (#178)
Also updated docs, and noticed an issue with the add_texts method on
VectorStores that I had missed before -- the metadatas arg should be
required to match the classmethod which initializes the VectorStores
(the add_example methods break otherwise in the ExampleSelectors)
2 years ago
Harrison Chase 780ef84cf0
use action verb in documentation (#175) 2 years ago
Harrison Chase 5d887970f6
change to agent (#173) 2 years ago
Harrison Chase d3a7429f61
(WIP) agents (#171) 2 years ago
Harrison Chase 4a4dfbfbed
Harrison/sequential chains (#168)
add support for basic sequential chains
2 years ago
Jim Salmons e9baf9c134
Update llm.md (#164)
Without the print on the `llm` call, the new user sees no visible effect
when just getting started. The assumption here is the new user is
running this in a new sandbox script file or repl via copy-paste.
2 years ago
Harrison Chase e49fc51492
Harrison/update docs (#162)
minor update to docs re imports
2 years ago
Harrison Chase 243211a5ae
bump version to 0017 (#161) 2 years ago
Harrison Chase a19ad935b3
Harrison/verbose prompt (#159)
Add printing of prompt to LLMChain
2 years ago
Harrison Chase c02eb199b6
add few shot example (#148) 2 years ago
Harrison Chase b15c84e19d
Harrison/chain lab (#156) 2 years ago
Harrison Chase b1b6b27c5f
Harrison/redo docs (#130)
Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
2 years ago
Harrison Chase 5e76c12455
Harrison/fix docs (#115) 2 years ago
Harrison Chase a7d14cad00
add link to socratic models (#69) 2 years ago
Harrison Chase 618611f4dd
update glossary (#63) 2 years ago
Harrison Chase 8f907161e3
Harrison/initial glossary (#61) 2 years ago
Harrison Chase 76aff023d7
FAISS and embedding support (#48)
also adds embeddings and an in memory docstore
2 years ago
Harrison Chase 5621ca7b07
Harrison/more documentation (#19) 2 years ago
Harrison Chase 18aeb72012 initial commit 2 years ago