MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / StreamedMessage

Interface StreamedMessage

packages/kosong/src/provider.ts:75–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73 * the provider.
74 */
75export interface StreamedMessage {
76 [Symbol.asyncIterator](): AsyncIterator<StreamedMessagePart>;
77 /** Provider-assigned response identifier, or `null` if not available. */
78 readonly id: string | null;
79 /** Token usage statistics, populated after the stream completes. */
80 readonly usage: TokenUsage | null;
81 /**
82 * Normalized finish reason, populated after the stream completes.
83 *
84 * `null` if the provider did not emit a finish_reason (for example, the
85 * stream was interrupted before the final event arrived).
86 */
87 readonly finishReason: FinishReason | null;
88 /**
89 * Raw provider-specific finish_reason string, preserved verbatim as an
90 * escape hatch for callers that need the original wire value.
91 *
92 * `null` if the provider did not emit a finish_reason.
93 */
94 readonly rawFinishReason: string | null;
95}
96
97/**
98 * Options that can be forwarded to a single {@link ChatProvider.generate} call.

Callers

nothing calls this directly

Implementers 8

EchoStreamedMessagepackages/kosong/test/fixtures/echo-pro
MockStreamedMessagepackages/kosong/test/fixtures/mock-pro
OpenAILegacyStreamedMessagepackages/kosong/src/providers/openai-l
OpenAIResponsesStreamedMessagepackages/kosong/src/providers/openai-r
AnthropicStreamedMessagepackages/kosong/src/providers/anthropi
KimiStreamedMessagepackages/kosong/src/providers/kimi.ts
GoogleGenAIStreamedMessagepackages/kosong/src/providers/google-g
ConfigurableMockProviderpackages/kosong/test/e2e/provider-swit

Calls

no outgoing calls

Tested by

no test coverage detected