Commit Graph

9 Commits (main)

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 9e04c34e20
Add BaseCallbackHandler and CallbackManager (#478)
Co-authored-by: Ankush Gola <9536492+agola11@users.noreply.github.com>
1 year ago
Harrison Chase e02d6b2288
beta: logger (#307) 1 year ago
Harrison Chase 9481a23314
stop using chained input except in agent (#249) 1 year ago
Nicholas Larus-Stone 0c3ae78ec1
chore: update ascii colors to work with dark mode (#152) 2 years ago
Harrison Chase bbb405a492
update colors (#140) 2 years ago
Harrison Chase db37bd089f
model laboratory (#95) 2 years ago
Harrison Chase 2456a547de
mrkl (#42) 2 years ago
Harrison Chase 4cc18d6c2a
Harrison/pretty print (#57)
make stuff look nice
2 years ago