Skip to content

Commit

Permalink
fix: skip json parse if tool call function arguments attribute doesn'…
Browse files Browse the repository at this point in the history
…t exist (#5874)

Co-authored-by: Anthony Powell <[email protected]>
  • Loading branch information
RogerHYang and cephalization authored Jan 2, 2025
1 parent 179859b commit 878f1c1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/src/pages/trace/SpanDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1331,11 +1331,13 @@ function LLMMessage({ message }: { message: AttributeMessage }) {
`}
>
{toolCall?.function?.name as string}(
{JSON.stringify(
JSON.parse(toolCall?.function?.arguments as string),
null,
2
)}
{typeof toolCall?.function?.arguments === "string"
? JSON.stringify(
JSON.parse(toolCall?.function?.arguments as string),
null,
2
)
: ""}
)
</pre>
);
Expand Down

0 comments on commit 878f1c1

Please sign in to comment.