From 9ab96e12ed002facaa57fc7fed7f10a8ee1c52a7 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Tue, 28 May 2024 22:27:09 -0700 Subject: [PATCH] fix - update abatch_completion docstring --- litellm/router.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/litellm/router.py b/litellm/router.py index a2a03da86..9c9f81dc8 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -672,6 +672,29 @@ class Router: Async Batch Completion. Used for 2 scenarios: 1. Batch Process 1 request to N models on litellm.Router. Pass messages as List[Dict[str, str]] to use this 2. Batch Process N requests to M models on litellm.Router. Pass messages as List[List[Dict[str, str]]] to use this + + Example Request for 1 request to N models: + ``` + response = await router.abatch_completion( + models=["gpt-3.5-turbo", "groq-llama"], + messages=[ + {"role": "user", "content": "is litellm becoming a better product ?"} + ], + max_tokens=15, + ) + ``` + + + Example Request for N requests to M models: + ``` + response = await router.abatch_completion( + models=["gpt-3.5-turbo", "groq-llama"], + messages=[ + [{"role": "user", "content": "is litellm becoming a better product ?"}], + [{"role": "user", "content": "who is this"}], + ], + ) + ``` """ ############## Helpers for async completion ##################