Documentation
¶
Overview ¶
Package kimicode provides Kimi Code API integration for the LLM gateway.
The "kimicode" provider routes to Kimi Code's OpenAI-compatible API: chat completions, model listing, embeddings, and passthrough go through the shared chat-centric adapter, while the Responses API is served natively by the upstream /responses endpoint. Kimi Code retains no responses, so store=true is pinned to false.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Registration = providers.Registration{ Type: "kimicode", New: New, Discovery: providers.DiscoveryConfig{ DefaultBaseURL: defaultBaseURL, }, }
Registration provides factory registration for the Kimi Code provider.
Functions ¶
func New ¶
func New(cfg providers.ProviderConfig, opts providers.ProviderOptions) core.Provider
New creates a new Kimi Code provider.
Types ¶
type Provider ¶
type Provider struct {
*openai.ChatCompatible
}
Provider implements the core.Provider interface for Kimi Code. Kimi Code is OpenAI-compatible, so most transport goes through the shared chat-centric adapter: chat completions, model listing, embeddings, and passthrough are exposed via the embedded *openai.ChatCompatible. The Responses API is forwarded natively to the upstream /responses endpoint through the same adapter instance.
func (*Provider) Responses ¶ added in v0.1.99
func (p *Provider) Responses(ctx context.Context, req *core.ResponsesRequest) (*core.ResponsesResponse, error)
Responses serves the Responses API natively through the upstream /responses endpoint. Kimi Code retains no responses, so a non-empty previous_response_id is rejected before any upstream call (see rejectPreviousResponseID); store=true is pinned to false by adaptResponsesRequest.
func (*Provider) StreamResponses ¶ added in v0.1.99
func (p *Provider) StreamResponses(ctx context.Context, req *core.ResponsesRequest) (io.ReadCloser, error)
StreamResponses forwards the request to the upstream /responses endpoint with stream enabled, returning its Responses SSE stream. Like Responses, it rejects a non-empty previous_response_id before any upstream call.