langchain/langchain
Louis Amaudruz e455ba4ed5
Add async support to routing chains (#5373)
# Add async support for (LLM) routing chains

<!--
Thank you for contributing to LangChain! Your PR will appear in our
release under the title you set. Please make sure it highlights your
valuable contribution.

Replace this with a description of the change, the issue it fixes (if
applicable), and relevant context. List any dependencies required for
this change.

After you're done, someone will review your PR. They may suggest
improvements. If no one reviews your PR within a few days, feel free to
@-mention the same people again, as notifications can get lost.
-->

<!-- Remove if not applicable -->

Add asynchronous LLM calls support for the routing chains. More
specifically:
- Add async `aroute` function (i.e. async version of `route`) to the
`RouterChain` which calls the routing LLM asynchronously
- Implement the async `_acall` for the `LLMRouterChain`
- Implement the async `_acall` function for `MultiRouteChain` which
first calls asynchronously the routing chain with its new `aroute`
function, and then calls asynchronously the relevant destination chain.

<!-- If you're adding a new integration, please include:

1. a test for the integration - favor unit tests that does not rely on
network access.
2. an example notebook showing its use


See contribution guidelines for more information on how to write tests,
lint
etc:


https://github.com/hwchase17/langchain/blob/master/.github/CONTRIBUTING.md
-->

## Who can review?

- @agola11

<!-- For a quicker response, figure out the right person to tag with @

  @hwchase17 - project lead
  Async
  - @agola11
        
 -->
2023-05-29 06:37:26 -07:00
..
agents Use Default Factory (#5380) 2023-05-29 06:22:35 -07:00
callbacks Log warning (#5192) 2023-05-24 21:05:13 +00:00
chains Add async support to routing chains (#5373) 2023-05-29 06:37:26 -07:00
chat_models OpenAI lint (#5273) 2023-05-25 16:20:06 -07:00
cli Add 'status' command to get server status (#5197) 2023-05-24 21:43:16 +00:00
client Add Delete Session Method (#5193) 2023-05-24 21:06:03 +00:00
docstore changed ValueError to ImportError (#5006) 2023-05-19 15:28:08 -07:00
document_loaders fix: Blob.from_data mimetype is lost (#5395) 2023-05-29 06:36:50 -07:00
embeddings OpenAI lint (#5273) 2023-05-25 16:20:06 -07:00
evaluation Replace remaining usage of basellm with baselangmodel (#3981) 2023-05-02 21:52:29 -07:00
experimental fix: remove empty lines that cause InvalidRequestError (#5320) 2023-05-27 21:15:03 -07:00
graphs changed ValueError to ImportError (#5103) 2023-05-22 15:24:45 -07:00
indexes Create async copy of from_text() inside GraphIndexCreator. (#5214) 2023-05-24 21:54:12 -07:00
llms Fixed passing creds to VertexAI LLM (#5297) 2023-05-26 08:31:02 -07:00
memory added cosmos kwargs option (#5292) 2023-05-27 21:19:40 -07:00
output_parsers handle json parsing errors (#5371) 2023-05-29 06:18:19 -07:00
prompts fix prompt saving (#4987) 2023-05-20 08:21:52 -07:00
retrievers Fix: Handle empty documents in ContextualCompressionRetriever (Issue #5304) (#5306) 2023-05-28 13:19:34 -07:00
tools Add visible_only and strict_mode options to ClickTool (#4088) 2023-05-25 14:10:39 -07:00
utilities feat: support for shopping search in SerpApi (#5259) 2023-05-27 21:20:24 -07:00
vectorstores Fixes iter error in FAISS add_embeddings call (#5367) 2023-05-28 09:59:30 -07:00
__init__.py console callback verbose (#4696) 2023-05-17 01:28:43 +00:00
base_language.py Add async versions of predict() and predict_messages() (#4867) 2023-05-23 17:22:49 -07:00
cache.py feat: add Momento as a standard cache and chat message history provider (#5221) 2023-05-25 19:13:21 -07:00
docker-compose.yaml Update docker-compose.yaml (#3582) 2023-04-26 15:11:59 -07:00
document_transformers.py Contextual compression retriever (#2915) 2023-04-20 17:01:14 -07:00
env.py Add Environment Info to Run (#4691) 2023-05-15 15:38:49 +00:00
example_generator.py Replace remaining usage of basellm with baselangmodel (#3981) 2023-05-02 21:52:29 -07:00
formatting.py Validate input_variables when using jinja2 templates (#3140) 2023-04-19 16:18:32 -07:00
input.py Bold Crumbs (#4876) 2023-05-17 22:50:35 +00:00
math_utils.py add get_top_k_cosine_similarity method to get max top k score and index (#5059) 2023-05-22 11:55:48 -07:00
model_laboratory.py Harrison/improve cache (#368) 2022-12-18 16:22:42 -05:00
py.typed Add py.typed marker to package (#121) 2022-11-12 11:22:32 -08:00
python.py Move PythonRepl -> langchain.utilities (#2917) 2023-04-15 10:50:25 -07:00
requests.py fixed aiohttp.client_exceptions.ClientConnectionError: Connection closed (#2718) 2023-04-11 10:52:55 -07:00
schema.py Improving Resilience of MRKL Agent (#5014) 2023-05-22 11:08:08 -07:00
serpapi.py move serpapi wrapper (#1199) 2023-02-20 21:15:45 -08:00
server.py Update Tracing Walkthrough (#4760) 2023-05-16 13:26:43 +00:00
sql_database.py Support bigquery dialect - SQL (#5261) 2023-05-25 18:19:17 -07:00
text_splitter.py Improve effeciency of TextSplitter.split_documents, iterate once (#5111) 2023-05-22 23:00:24 -04:00
utils.py Harrison/virtual time (#4658) 2023-05-14 10:29:17 -07:00