Files
openclaw/src/gateway/openresponses-shape.ts
2026-04-05 10:58:49 +01:00

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,
};
}