diegosouzapw/OmniRoute · error · Error

Kimi Web does not support image, audio, file, or tool…

Error message

Kimi Web does not support image, audio, file, or tool content

What it means

Capability validation in textFromContent: a content part is an object whose type is not text/input_text (image_url, audio, file, tool data). Kimi Web has no multimodal input, so non-text parts abort the fold.

Solutions

  1. Reject with a 400 naming the unsupported part type
  2. Route multimodal requests to a capable provider instead of Kimi Web
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at open-sse/executors/kimi-web.ts:227 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/bf65471ec2ad68ea. Report an issue: GitHub.

Appendix: source

Thrown at open-sse/executors/kimi-web.ts:227

function textFromContent(content: unknown): string {
  if (typeof content === "string") return content;
  if (!Array.isArray(content)) {
    throw new Error("Kimi Web only supports text message content");
  }

  return content
    .map((part) => {
      if (!part || typeof part !== "object" || Array.isArray(part)) {
        throw new Error("Kimi Web only supports text message content");
      }
      const record = part as Record<string, unknown>;
      if (
        (record.type === "text" || record.type === "input_text") &&
        typeof record.text === "string"
      ) {
        return record.text;
      }
      throw new Error("Kimi Web does not support image, audio, file, or tool content");
    })
    .join("");
}

/** Fold text-only OpenAI history into the single user turn accepted by Kimi Web. */
export function foldMessages(messages: KimiWebInputMessage[]): FoldedKimiWebMessages {
  const systemParts: string[] = [];
  const conversationParts: string[] = [];

  for (const message of messages) {
    if (message.role === "tool" || message.role === "function") {
      throw new Error("Kimi Web does not support tool result messages");
    }
    if (message.tool_calls !== undefined) {
      throw new Error("Kimi Web does not support assistant tool calls");
    }

    const text = textFromContent(message.content);

View on GitHub (pinned to a179ffed5b)