langchain/tests/unit_tests/chains
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
..
__init__.py initial commit 2022-10-24 14:51:15 -07:00
test_api.py LLMRequestsChain (#267) 2022-12-06 21:55:02 -08:00
test_base.py Add BaseCallbackHandler and CallbackManager (#478) 2023-01-04 07:54:25 -08:00
test_combine_documents.py fix map reduce chain (#550) 2023-01-06 07:15:57 -08:00
test_conversation.py Harrison/add human prefix (#520) 2023-01-03 08:03:50 -08:00
test_hyde.py Add asyncio support for LLM (OpenAI), Chain (LLMChain, LLMMathChain), and Agent (#841) 2023-02-07 21:21:57 -08:00
test_llm_bash.py update branch name in gha (#274) 2022-12-06 22:28:50 -08:00
test_llm_checker.py Add LLMCheckerChain (#281) 2022-12-09 12:49:05 -08:00
test_llm_math.py initial commit 2022-10-24 14:51:15 -07:00
test_llm.py Harrison/serialize llm chain (#671) 2023-01-24 21:36:19 -08:00
test_natbot.py Harrison/cache (#343) 2022-12-15 07:53:32 -08:00
test_sequential.py chore: minor clean up / formatting (#233) 2022-12-01 10:50:36 -08:00
test_transform.py Add a Transformation Chain (#257) 2022-12-06 21:58:16 -08:00