Skip to content

Commit 224f548

Browse files
committed
pretty
1 parent 8e007ec commit 224f548

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

packages/traceloop-sdk/src/lib/tracing/ai-sdk-transformations.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,10 @@ const processMessageContent = (content: any): string => {
151151
if (Array.isArray(content)) {
152152
const textItems = content.filter(
153153
(item: any) =>
154-
item && typeof item === "object" && item.type === TYPE_TEXT && item.text,
154+
item &&
155+
typeof item === "object" &&
156+
item.type === TYPE_TEXT &&
157+
item.text,
155158
);
156159

157160
if (textItems.length > 0) {
@@ -292,7 +295,8 @@ const transformPrompts = (attributes: Record<string, any>): void => {
292295
try {
293296
const promptData = JSON.parse(attributes[AI_PROMPT] as string);
294297
if (promptData.prompt && typeof promptData.prompt === "string") {
295-
attributes[`${SpanAttributes.LLM_PROMPTS}.0.content`] = promptData.prompt;
298+
attributes[`${SpanAttributes.LLM_PROMPTS}.0.content`] =
299+
promptData.prompt;
296300
attributes[`${SpanAttributes.LLM_PROMPTS}.0.role`] = ROLE_USER;
297301

298302
const inputMessage = {

packages/traceloop-sdk/test/ai-sdk-transformations.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1488,7 +1488,8 @@ describe("AI SDK Transformations", () => {
14881488
},
14891489
{
14901490
role: "user",
1491-
content: "Can you get the weather for this location using your tools?",
1491+
content:
1492+
"Can you get the weather for this location using your tools?",
14921493
},
14931494
];
14941495

0 commit comments

Comments
 (0)