From 06a66c898b4a7dd7bed39131bbbe46c79de03907 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Mon, 4 Sep 2023 16:01:28 -0700 Subject: [PATCH] docs update fallbacks --- docs/my-website/docs/completion/reliable_completions.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/my-website/docs/completion/reliable_completions.md b/docs/my-website/docs/completion/reliable_completions.md index eb37c3941e..e9a0a2f6c6 100644 --- a/docs/my-website/docs/completion/reliable_completions.md +++ b/docs/my-website/docs/completion/reliable_completions.md @@ -41,10 +41,6 @@ The `fallbacks` list should include the primary model you want to use, followed response = completion(model="bad-model", fallbacks=["gpt-3.5-turbo" "command-nightly"], messages=messages) ``` -## How does `completion_with_fallbacks()` work - -The `completion_with_fallbacks()` function attempts a completion call using the primary model specified as `model` in `completion(model=model)`. If the primary model fails or encounters an error, it automatically tries the `fallbacks` models in the specified order. This ensures a response even if the primary model is unavailable. - ### Output from calls ``` Completion with 'bad-model': got exception Unable to map your input to a model. Check your input - {'model': 'bad-model' @@ -76,6 +72,11 @@ completion call gpt-3.5-turbo ``` +## How does fallbacks work + +When you pass `fallbacks` to `completion`, it makes the first `completion` call using the primary model specified as `model` in `completion(model=model)`. If the primary model fails or encounters an error, it automatically tries the `fallbacks` models in the specified order. This ensures a response even if the primary model is unavailable. + + ### Key components of Model Fallbacks implementation: * Looping through `fallbacks` * Cool-Downs for rate-limited models