Skip to content

Commit 520febd

Browse files
Update langfuse/openai.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
1 parent c4dd552 commit 520febd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

langfuse/openai.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,9 +665,10 @@ def _get_langfuse_data_from_default_response(resource: OpenAiDefinition, respons
665665
elif resource.object == "Responses":
666666
output = response.get("output", {})
667667

668-
if len(output) > 1:
668+
if not isinstance(output, list):
669+
completion = output
670+
elif len(output) > 1:
669671
completion = output
670-
671672
elif len(output) == 1:
672673
completion = output[0]
673674

0 commit comments

Comments
 (0)