From 93e2c8264224222bf0df924741bf2c666742f3e6 Mon Sep 17 00:00:00 2001 From: David Lojudice Sobrinho Date: Sat, 24 May 2025 13:12:11 -0300 Subject: [PATCH] fix(session): correctly place litellm_session_id at root level instead of metadata (#11088) - Update documentation examples to show correct implementation - Resolves #11065 --- .../my-website/docs/proxy/ui_logs_sessions.md | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/docs/my-website/docs/proxy/ui_logs_sessions.md b/docs/my-website/docs/proxy/ui_logs_sessions.md index a1a3003478b..5efd7d4cb9e 100644 --- a/docs/my-website/docs/proxy/ui_logs_sessions.md +++ b/docs/my-website/docs/proxy/ui_logs_sessions.md @@ -43,9 +43,7 @@ response1 = client.chat.completions.create( } ], extra_body={ - "metadata": { - "litellm_session_id": session_id # Pass the session ID - } + "litellm_session_id": session_id # Pass the session ID } ) ``` @@ -64,9 +62,7 @@ response2 = client.chat.completions.create( } ], extra_body={ - "metadata": { - "litellm_session_id": session_id # Reuse the same session ID - } + "litellm_session_id": session_id # Reuse the same session ID } ) ``` @@ -89,9 +85,7 @@ chat = ChatOpenAI( api_key="", model="gpt-4o", extra_body={ - "metadata": { - "litellm_session_id": session_id # Pass the session ID - } + "litellm_session_id": session_id # Pass the session ID } ) @@ -132,9 +126,7 @@ curl --location 'http://0.0.0.0:4000/chat/completions' \ "content": "Write a short story about a robot" } ], - "metadata": { - "litellm_session_id": "'$SESSION_ID'" - } + "litellm_session_id": "'$SESSION_ID'" }' ``` @@ -154,9 +146,7 @@ curl --location 'http://0.0.0.0:4000/chat/completions' \ "content": "Now write a poem about that robot" } ], - "metadata": { - "litellm_session_id": "'$SESSION_ID'" - } + "litellm_session_id": "'$SESSION_ID'" }' ```