mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-15 19:21:08 +00:00
35 lines
821 B
TypeScript
35 lines
821 B
TypeScript
import type { OutputItem } from "./open-responses.schema.js";
|
|
|
|
export function createAssistantOutputItem(params: {
|
|
id: string;
|
|
text: string;
|
|
phase?: "commentary" | "final_answer";
|
|
status?: "in_progress" | "completed";
|
|
}): OutputItem {
|
|
return {
|
|
type: "message",
|
|
id: params.id,
|
|
role: "assistant",
|
|
content: [{ type: "output_text", text: params.text }],
|
|
...(params.phase ? { phase: params.phase } : {}),
|
|
status: params.status,
|
|
};
|
|
}
|
|
|
|
export function createFunctionCallOutputItem(params: {
|
|
id: string;
|
|
callId: string;
|
|
name: string;
|
|
arguments: string;
|
|
status?: "in_progress" | "completed";
|
|
}): OutputItem {
|
|
return {
|
|
type: "function_call",
|
|
id: params.id,
|
|
call_id: params.callId,
|
|
name: params.name,
|
|
arguments: params.arguments,
|
|
status: params.status,
|
|
};
|
|
}
|