From 14124bab45d2a776bc564e26d5f30101d57a3518 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Thu, 21 Nov 2024 21:46:49 -0800 Subject: [PATCH] docs - Send `litellm_metadata` (tags) --- .../docs/pass_through/anthropic_completion.md | 56 ++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/docs/my-website/docs/pass_through/anthropic_completion.md b/docs/my-website/docs/pass_through/anthropic_completion.md index 320527580bc..3f247adbd05 100644 --- a/docs/my-website/docs/pass_through/anthropic_completion.md +++ b/docs/my-website/docs/pass_through/anthropic_completion.md @@ -314,4 +314,58 @@ curl --request POST \ {"role": "user", "content": "Hello, world"} ] }' -``` \ No newline at end of file +``` + + +### Send `litellm_metadata` (tags) + + + + +```bash +curl --request POST \ + --url http://0.0.0.0:4000/anthropic/v1/messages \ + --header 'accept: application/json' \ + --header 'content-type: application/json' \ + --header "Authorization: bearer sk-anything" \ + --data '{ + "model": "claude-3-5-sonnet-20241022", + "max_tokens": 1024, + "messages": [ + {"role": "user", "content": "Hello, world"} + ], + "litellm_metadata": { + "tags": ["test-tag-1", "test-tag-2"] + } + }' +``` + + + + +```python +from anthropic import Anthropic + +client = Anthropic( + base_url="http://0.0.0.0:4000/anthropic", + api_key="sk-anything" +) + +response = client.messages.create( + model="claude-3-5-sonnet-20241022", + max_tokens=1024, + messages=[ + {"role": "user", "content": "Hello, world"} + ], + extra_body={ + "litellm_metadata": { + "tags": ["test-tag-1", "test-tag-2"] + } + } +) + +print(response) +``` + + + \ No newline at end of file