mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 20:00:47 +00:00
44 lines
1.2 KiB
JavaScript
44 lines
1.2 KiB
JavaScript
// Content-block "type" discriminators — fixed per format. Pure data (no logic).
|
|
|
|
// OpenAI chat content blocks + tool_call wrapper.
|
|
export const OPENAI_BLOCK = {
|
|
TEXT: "text",
|
|
IMAGE_URL: "image_url",
|
|
IMAGE: "image",
|
|
INPUT_AUDIO: "input_audio",
|
|
AUDIO_URL: "audio_url",
|
|
FILE: "file",
|
|
FUNCTION: "function",
|
|
};
|
|
|
|
// Claude content blocks.
|
|
export const CLAUDE_BLOCK = {
|
|
TEXT: "text",
|
|
IMAGE: "image",
|
|
DOCUMENT: "document",
|
|
TOOL_USE: "tool_use",
|
|
TOOL_RESULT: "tool_result",
|
|
THINKING: "thinking",
|
|
REDACTED_THINKING: "redacted_thinking",
|
|
};
|
|
|
|
// OpenAI Responses API item types.
|
|
export const RESPONSES_ITEM = {
|
|
MESSAGE: "message",
|
|
FUNCTION_CALL: "function_call",
|
|
FUNCTION_CALL_OUTPUT: "function_call_output",
|
|
REASONING: "reasoning",
|
|
OUTPUT_TEXT: "output_text",
|
|
INPUT_TEXT: "input_text",
|
|
INPUT_IMAGE: "input_image",
|
|
SUMMARY_TEXT: "summary_text",
|
|
};
|
|
|
|
// Valid OpenAI block types (used by filterToOpenAIFormat).
|
|
export const VALID_OPENAI_CONTENT_TYPES = [
|
|
OPENAI_BLOCK.TEXT, OPENAI_BLOCK.IMAGE_URL, OPENAI_BLOCK.IMAGE, OPENAI_BLOCK.INPUT_AUDIO, OPENAI_BLOCK.AUDIO_URL, OPENAI_BLOCK.FILE,
|
|
];
|
|
export const VALID_OPENAI_MESSAGE_TYPES = [
|
|
OPENAI_BLOCK.TEXT, OPENAI_BLOCK.IMAGE_URL, OPENAI_BLOCK.IMAGE, "tool_calls", CLAUDE_BLOCK.TOOL_RESULT,
|
|
];
|