From 81b4f47140cb49e4c7a9e10686fc895bbc7fe5f4 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Fri, 29 Mar 2024 11:58:49 -0700 Subject: [PATCH] docs: show how tool calling parsing works + how to get raw model response --- docs/my-website/docs/providers/anthropic.md | 9 +++++++++ docs/my-website/docs/providers/bedrock.md | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/docs/my-website/docs/providers/anthropic.md b/docs/my-website/docs/providers/anthropic.md index 792e57fc03..22e9eb5596 100644 --- a/docs/my-website/docs/providers/anthropic.md +++ b/docs/my-website/docs/providers/anthropic.md @@ -175,6 +175,15 @@ print(response) ## Usage - Function Calling +:::info + +Claude returns it's output as an XML Tree. [Here is how we translate it](https://github.com/BerriAI/litellm/blob/49642a5b00a53b1babc1a753426a8afcac85dbbe/litellm/llms/prompt_templates/factory.py#L734). + +You can see the raw response via `response._hidden_params["original_response"]`. + +Claude hallucinates, e.g. returning the list param `value` as `\napple\nbanana\n` or `\n\napple\nbanana\n\n`. +::: + ```python from litellm import completion diff --git a/docs/my-website/docs/providers/bedrock.md b/docs/my-website/docs/providers/bedrock.md index 6da788d977..590ffc423b 100644 --- a/docs/my-website/docs/providers/bedrock.md +++ b/docs/my-website/docs/providers/bedrock.md @@ -146,6 +146,15 @@ print(response) ## Usage - Function Calling +:::info + +Claude returns it's output as an XML Tree. [Here is how we translate it](https://github.com/BerriAI/litellm/blob/49642a5b00a53b1babc1a753426a8afcac85dbbe/litellm/llms/prompt_templates/factory.py#L734). + +You can see the raw response via `response._hidden_params["original_response"]`. + +Claude hallucinates, e.g. returning the list param `value` as `\napple\nbanana\n` or `\n\napple\nbanana\n\n`. +::: + ```python from litellm import completion