Commit Graph

20 Commits (bc7e56e8df90822898930104eca5fc5cd5c1c962)

Author SHA1 Message Date
Ankush Gola bc7e56e8df
Add asyncio support for LLM (OpenAI), Chain (LLMChain, LLMMathChain), and Agent (#841)
Supporting asyncio in langchain primitives allows for users to run them
concurrently and creates more seamless integration with
asyncio-supported frameworks (FastAPI, etc.)

Summary of changes:

**LLM**
* Add `agenerate` and `_agenerate`
* Implement in OpenAI by leveraging `client.Completions.acreate`

**Chain**
* Add `arun`, `acall`, `_acall`
* Implement them in `LLMChain` and `LLMMathChain` for now

**Agent**
* Refactor and leverage async chain and llm methods
* Add ability for `Tools` to contain async coroutine
* Implement async SerpaPI `arun`

Create demo notebook.

Open questions:
* Should all the async stuff go in separate classes? I've seen both
patterns (keeping the same class and having async and sync methods vs.
having class separation)
1 year ago
Harrison Chase a2b699dcd2
prompt template from string (#884) 1 year ago
Harrison Chase 3f952eb597
add from string method (#820) 1 year ago
Harrison Chase 0ffeabd14f
Harrison/serialize llm chain (#671) 1 year ago
Harrison Chase cbc146720b
verbose flag (#683) 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
Harrison Chase b50a56830d
Harrison/evaluation notebook (#426) 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
Harrison Chase 3474f39e21
Harrison/improve cache (#368)
make it so everything goes through generate, which removes the need for
two types of caches
1 year ago
Harrison Chase 996b5a3dfb
Harrison/llm final stuff (#332) 1 year ago
Harrison Chase e02d6b2288
beta: logger (#307) 1 year ago
Harrison Chase db58032973
introduce output parser (#250) 2 years 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
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 f23b3ceb49
consolidate run functions (#126)
consolidating logic for when a chain is able to run with single input
text, single output text

open to feedback on naming, logic, usefulness
2 years ago
Samantha Whitmore a5b61d59e1
Refactor prompts into module, add example generation utils (#64) 2 years ago
Samantha Whitmore 4bbaa9b2d0
Add BasePrompt as abstract base class (#60) 2 years ago
Harrison Chase 5621ca7b07
Harrison/more documentation (#19) 2 years ago
Harrison Chase 18aeb72012 initial commit 2 years ago