mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-10 15:03:36 +00:00
doc: update opik integration doc
This commit is contained in:
@@ -140,6 +140,7 @@ These can be passed inside metadata with the `opik` key.
|
||||
- `project_name` - Name of the Opik project to send data to.
|
||||
- `current_span_data` - The current span data to be used for tracing.
|
||||
- `tags` - Tags to be used for tracing.
|
||||
- `thread_id` - The thread id to group together multiple related traces.
|
||||
|
||||
### Usage
|
||||
|
||||
@@ -159,8 +160,10 @@ response = litellm.completion(
|
||||
messages=messages,
|
||||
metadata = {
|
||||
"opik": {
|
||||
"project_name": "your-opik-project-name",
|
||||
"current_span_data": get_current_span_data(),
|
||||
"tags": ["streaming-test"],
|
||||
"thread_id": "your-thread-id"
|
||||
},
|
||||
}
|
||||
)
|
||||
@@ -174,7 +177,7 @@ curl -L -X POST 'http://0.0.0.0:4000/v1/chat/completions' \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Authorization: Bearer sk-1234' \
|
||||
-d '{
|
||||
"model": "gpt-3.5-turbo-testing",
|
||||
"model": "gpt-3.5-turbo",
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
@@ -183,8 +186,10 @@ curl -L -X POST 'http://0.0.0.0:4000/v1/chat/completions' \
|
||||
],
|
||||
"metadata": {
|
||||
"opik": {
|
||||
"project_name": "your-opik-project-name",
|
||||
"current_span_data": "...",
|
||||
"tags": ["streaming-test"],
|
||||
"thread_id": "your-thread-id"
|
||||
},
|
||||
}
|
||||
}'
|
||||
@@ -193,14 +198,25 @@ curl -L -X POST 'http://0.0.0.0:4000/v1/chat/completions' \
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
You can also pass the fields as part of the request header with a `opik_*` prefix:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
```shell
|
||||
curl --location --request POST 'http://0.0.0.0:4000/chat/completions' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--header 'Authorization: Bearer sk-1234' \
|
||||
--header 'opik_project_name: your-opik-project-name' \
|
||||
--header 'opik_thread_id: your-thread-id' \
|
||||
--header 'opik_tags: ["streaming-test"]' \
|
||||
--data '{
|
||||
"model": "gpt-3.5-turbo",
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "What's the weather like in Boston today?"
|
||||
}
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user