From 2b8a8297af3d6ccc80212e058de9f9fdd95eea9a Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Tue, 10 Oct 2023 10:04:47 -0700 Subject: [PATCH] (docs) fix tracking end users --- .../observability/supabase_integration.md | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/docs/my-website/docs/observability/supabase_integration.md b/docs/my-website/docs/observability/supabase_integration.md index 6ca7757681d..337e1a5beee 100644 --- a/docs/my-website/docs/observability/supabase_integration.md +++ b/docs/my-website/docs/observability/supabase_integration.md @@ -56,15 +56,35 @@ os.environ["OPENAI_API_KEY"] = "" litellm.success_callback=["supabase"] litellm.failure_callback=["supabase"] -#openai call -response = completion(model="gpt-3.5-turbo", messages=[{"role": "user", "content": "Hi 👋 - i'm openai"}]) +# openai call +response = completion( + model="gpt-3.5-turbo", + messages=[{"role": "user", "content": "Hi 👋 - i'm openai"}], + user="ishaan22" # identify users +) -#bad call -response = completion(model="chatgpt-test", messages=[{"role": "user", "content": "Hi 👋 - i'm a bad call to test error logging"}]) +# bad call, expect this call to fail and get logged +response = completion( + model="chatgpt-test", + messages=[{"role": "user", "content": "Hi 👋 - i'm a bad call to test error logging"}] +) + ``` ### Additional Controls +**Identify end-user** + +Pass `user` to `litellm.completion` to map your llm call to an end-user + +```python +response = completion( + model="gpt-3.5-turbo", + messages=[{"role": "user", "content": "Hi 👋 - i'm openai"}], + user="ishaan22" # identify users +) +``` + **Different Table name** If you modified your table name, here's how to pass the new name. @@ -72,11 +92,3 @@ If you modified your table name, here's how to pass the new name. ```python litellm.modify_integration("supabase",{"table_name": "litellm_logs"}) ``` - -**Identify end-user** - -Here's how to map your llm call to an end-user - -```python -litellm.identify({"end_user": "krrish@berri.ai"}) -``` \ No newline at end of file