docs - Send litellm_metadata (tags)

This commit is contained in:
Ishaan Jaff 2024-11-21 21:46:49 -08:00
parent 6717929206
commit 14124bab45

View file

@ -314,4 +314,58 @@ curl --request POST \
{"role": "user", "content": "Hello, world"}
]
}'
```
```
### Send `litellm_metadata` (tags)
<Tabs>
<TabItem value="curl" label="curl">
```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"]
}
}'
```
</TabItem>
<TabItem value="python" label="Anthropic Python SDK">
```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)
```
</TabItem>
</Tabs>