mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-18 00:57:15 +00:00
adding linted files and nvmrc -- will trigger precommit failures
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
This commit is contained in:
parent
ca80ab3b9e
commit
3f87db2eea
65 changed files with 1307 additions and 1137 deletions
|
|
@ -18,7 +18,7 @@ describe("extractTextFromContentPart", () => {
|
|||
it("should extract text from an array of text content objects", () => {
|
||||
const content = [{ type: "text", text: "Which planet do humans live on?" }];
|
||||
expect(extractTextFromContentPart(content)).toBe(
|
||||
"Which planet do humans live on?",
|
||||
"Which planet do humans live on?"
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ describe("extractTextFromContentPart", () => {
|
|||
{ type: "text", text: "It's an image." },
|
||||
];
|
||||
expect(extractTextFromContentPart(content)).toBe(
|
||||
"Look at this: [Image] It's an image.",
|
||||
"Look at this: [Image] It's an image."
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ describe("extractTextFromContentPart", () => {
|
|||
{ type: "text", text: "Last part." },
|
||||
] as any;
|
||||
expect(extractTextFromContentPart(content)).toBe(
|
||||
"First part. Just a string. [Image] Last part.",
|
||||
"First part. Just a string. [Image] Last part."
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
@ -125,7 +125,7 @@ describe("extractDisplayableText (composite function)", () => {
|
|||
tool_calls: [toolCall],
|
||||
};
|
||||
expect(extractDisplayableText(messageWithEffectivelyEmptyContent)).toBe(
|
||||
mockFormatToolCallToString(toolCall),
|
||||
mockFormatToolCallToString(toolCall)
|
||||
);
|
||||
|
||||
const messageWithEmptyContent: ChatMessage = {
|
||||
|
|
@ -134,7 +134,7 @@ describe("extractDisplayableText (composite function)", () => {
|
|||
tool_calls: [toolCall],
|
||||
};
|
||||
expect(extractDisplayableText(messageWithEmptyContent)).toBe(
|
||||
mockFormatToolCallToString(toolCall),
|
||||
mockFormatToolCallToString(toolCall)
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -149,7 +149,7 @@ describe("extractDisplayableText (composite function)", () => {
|
|||
};
|
||||
const expectedToolCallStr = mockFormatToolCallToString(toolCall);
|
||||
expect(extractDisplayableText(message)).toBe(
|
||||
`The result is: ${expectedToolCallStr}`,
|
||||
`The result is: ${expectedToolCallStr}`
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -167,7 +167,7 @@ describe("extractDisplayableText (composite function)", () => {
|
|||
};
|
||||
const expectedToolCallStr = mockFormatToolCallToString(toolCall);
|
||||
expect(extractDisplayableText(message)).toBe(
|
||||
`Okay, checking weather for London. ${expectedToolCallStr}`,
|
||||
`Okay, checking weather for London. ${expectedToolCallStr}`
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -178,7 +178,7 @@ describe("extractDisplayableText (composite function)", () => {
|
|||
tool_calls: [],
|
||||
};
|
||||
expect(extractDisplayableText(messageEmptyToolCalls)).toBe(
|
||||
"No tools here.",
|
||||
"No tools here."
|
||||
);
|
||||
|
||||
const messageUndefinedToolCalls: ChatMessage = {
|
||||
|
|
@ -187,7 +187,7 @@ describe("extractDisplayableText (composite function)", () => {
|
|||
tool_calls: undefined,
|
||||
};
|
||||
expect(extractDisplayableText(messageUndefinedToolCalls)).toBe(
|
||||
"Still no tools.",
|
||||
"Still no tools."
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue