Skip to content

Commit

Permalink
fix: 'NoneType' object has no attribute '__dict__' (#978)
Browse files Browse the repository at this point in the history
  • Loading branch information
bettlebrox authored Oct 25, 2024
1 parent 3d2655b commit 7d15848
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion langfuse/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ def _get_langfuse_data_from_default_response(resource: OpenAiDefinition, respons

usage = response.get("usage", None)

return model, completion, usage.__dict__ if _is_openai_v1() else usage
return model, completion, usage.__dict__ if _is_openai_v1() and usage is not None else usage


def _is_openai_v1():
Expand Down

0 comments on commit 7d15848

Please sign in to comment.