forked from phoenix/litellm-mirror
fix(llmonitor callback): correctly set user_id
This commit is contained in:
parent
8b9f30038d
commit
1897a1ee46
4 changed files with 5 additions and 4 deletions
|
@ -109,7 +109,7 @@ class LLMonitorLogger:
|
|||
},
|
||||
]
|
||||
|
||||
# print_verbose(f"LLMonitor Logging - final data object: {data}")
|
||||
print_verbose(f"LLMonitor Logging - final data object: {data}")
|
||||
|
||||
response = requests.post(
|
||||
self.api_url + "/api/report",
|
||||
|
|
|
@ -20,6 +20,7 @@ def test_chat_openai():
|
|||
response = completion(
|
||||
model="gpt-3.5-turbo",
|
||||
messages=[{"role": "user", "content": "Hi 👋 - i'm openai"}],
|
||||
user="ishaan_from_litellm"
|
||||
)
|
||||
|
||||
print(response)
|
||||
|
|
|
@ -1831,7 +1831,7 @@ def handle_failure(exception, traceback_exception, start_time, end_time, args, k
|
|||
llmonitorLogger.log_event(
|
||||
type=type,
|
||||
event="error",
|
||||
user_id=litellm._thread_context.user,
|
||||
user_id=kwargs.get("user", "default"),
|
||||
model=model,
|
||||
input=input,
|
||||
error=traceback_exception,
|
||||
|
@ -1951,7 +1951,7 @@ def handle_success(args, kwargs, result, start_time, end_time):
|
|||
event="end",
|
||||
model=model,
|
||||
input=input,
|
||||
user_id=litellm._thread_context.user,
|
||||
user_id=kwargs.get("user", "default"),
|
||||
response_obj=result,
|
||||
start_time=start_time,
|
||||
end_time=end_time,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[tool.poetry]
|
||||
name = "litellm"
|
||||
version = "0.1.822"
|
||||
version = "0.1.823"
|
||||
description = "Library to easily interface with LLM API providers"
|
||||
authors = ["BerriAI"]
|
||||
license = "MIT License"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue