langchain/tests/integration_tests/llms
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_ai21.py Harrison/cohere experimental (#638) 2023-01-17 22:28:55 -08:00
test_anthropic.py Harrison/athropic (#921) 2023-02-06 22:29:25 -08:00
test_cohere.py Harrison/llm saving (#331) 2022-12-13 06:46:01 -08:00
test_huggingface_endpoint.py Harrison/inference endpoint (#861) 2023-02-06 18:14:25 -08:00
test_huggingface_hub.py Harrison/llm saving (#331) 2022-12-13 06:46:01 -08:00
test_huggingface_pipeline.py Harrison/version 0040 (#366) 2022-12-17 07:53:22 -08:00
test_manifest.py Harrison/fix lint (#138) 2022-11-14 08:55:59 -08:00
test_nlpcloud.py Harrison/llm saving (#331) 2022-12-13 06:46:01 -08:00
test_openai.py Add asyncio support for LLM (OpenAI), Chain (LLMChain, LLMMathChain), and Agent (#841) 2023-02-07 21:21:57 -08:00
utils.py Harrison/improve cache (#368) 2022-12-18 16:22:42 -05:00