mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
fix(utils.py): fix langfuse integration
This commit is contained in:
parent
7d3b653a99
commit
04ce14e404
5 changed files with 44 additions and 35 deletions
|
@ -37,7 +37,7 @@ class LangFuseLogger:
|
|||
f"Langfuse Logging - Enters logging function for model {kwargs}"
|
||||
)
|
||||
metadata = kwargs.get("metadata", {})
|
||||
prompt = [kwargs['messages']]
|
||||
prompt = [kwargs.get('messages')]
|
||||
|
||||
# langfuse does not accept jsons for logging metadata #
|
||||
kwargs.pop("litellm_logging_obj", None)
|
||||
|
@ -52,7 +52,7 @@ class LangFuseLogger:
|
|||
startTime=start_time,
|
||||
endTime=end_time,
|
||||
model=kwargs['model'],
|
||||
modelParameters= kwargs,
|
||||
modelParameters= kwargs["optional_params"],
|
||||
prompt=prompt,
|
||||
completion=response_obj['choices'][0]['message'],
|
||||
usage=Usage(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue