openclaw/src/agents/live-test-helpers.ts
2026-03-03 00:15:00 +00:00

25 lines
498 B
TypeScript

export const LIVE_OK_PROMPT = "Reply with the word ok.";
export function createSingleUserPromptMessage(content = LIVE_OK_PROMPT) {
return [
{
role: "user" as const,
content,
timestamp: Date.now(),
},
];
}
export function extractNonEmptyAssistantText(
content: Array<{
type?: string;
text?: string;
}>,
) {
return content
.filter((block) => block.type === "text")
.map((block) => block.text?.trim() ?? "")
.filter(Boolean)
.join(" ");
}