Commit Graph

9 Commits

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)
2023-02-07 21:21:57 -08:00
Harrison Chase
9e04c34e20
Add BaseCallbackHandler and CallbackManager (#478)
Co-authored-by: Ankush Gola <9536492+agola11@users.noreply.github.com>
2023-01-04 07:54:25 -08:00
Harrison Chase
e02d6b2288
beta: logger (#307) 2022-12-10 23:17:19 -08:00
Harrison Chase
9481a23314
stop using chained input except in agent (#249) 2022-12-03 14:15:56 -08:00
Nicholas Larus-Stone
0c3ae78ec1
chore: update ascii colors to work with dark mode (#152) 2022-11-16 22:05:28 -08:00
Harrison Chase
bbb405a492
update colors (#140) 2022-11-14 20:27:36 -08:00
Harrison Chase
db37bd089f
model laboratory (#95) 2022-11-08 22:17:10 -08:00
Harrison Chase
2456a547de
mrkl (#42) 2022-11-05 14:41:53 -07:00
Harrison Chase
4cc18d6c2a
Harrison/pretty print (#57)
make stuff look nice
2022-11-03 00:41:07 -07:00