mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
Based on the data-type using json
The value of response_obj["choices"][0]["message"] is Message object and dict Added a conditional to use .json only iff it is Message Object
This commit is contained in:
parent
66a1b581e5
commit
c45085b728
1 changed files with 3 additions and 1 deletions
|
|
@ -135,7 +135,9 @@ class LangFuseLogger:
|
|||
response_obj, litellm.ModelResponse
|
||||
):
|
||||
input = prompt
|
||||
output = response_obj["choices"][0]["message"].json()
|
||||
output = response_obj["choices"][0]["message"]
|
||||
if isinstance(output, litellm.Message):
|
||||
output = output.json()
|
||||
elif response_obj is not None and isinstance(
|
||||
response_obj, litellm.TextCompletionResponse
|
||||
):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue