chat-relay/docs/provider-kimi-k2.md
2025-07-24 20:00:32 -04:00

1,006 B

Kimi K2 Provider Architecture

This document describes the KimiK2Provider used by the extension to automate the Kimi K2 chat interface.


🧩 Overview

KimiK2Provider is modeled after the existing AI Studio and ChatGPT providers. It sends messages and captures responses from k2.kimi.ai using DOM based monitoring by default with an optional debugger fallback.


⚙️ Configurable Options

this.captureMethod = 'dom'; // or 'debugger'
this.debuggerUrlPattern = '*k2.kimi.ai/api/chat*';
this.includeThinkingInMessage = false;

📌 DOM Selectors

  • Input field: textarea, div[contenteditable="true"]
  • Send button: button[type="submit"], button.send-btn
  • Response blocks: .message.ai, .chat-message.ai
  • Typing indicator: .typing, .loading

Summary

The provider offers a lightweight integration with Kimi K2 using the same structure as the other providers. It can capture responses via DOM observation or via Chrome debugger when configured.