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

Class StreamingLLM

packages/agent-core/test/loop/streaming.e2e.test.ts:23–36  ·  view source on GitHub ↗

* A custom LLM that exposes onTextDelta / onThinkDelta / onToolCallDelta / * onTextPart / onThinkPart so each test can decide what the provider emits.

Source from the content-addressed store, hash-verified

21 * onTextPart / onThinkPart so each test can decide what the provider emits.
22 */
23class StreamingLLM implements LLM {
24 readonly systemPrompt = 'streaming system prompt';
25 readonly modelName = 'streaming';
26
27 readonly responseProvider: (params: LLMChatParams) => Promise<LLMChatResponse>;
28
29 constructor(provider: (params: LLMChatParams) => Promise<LLMChatResponse>) {
30 this.responseProvider = provider;
31 }
32
33 async chat(params: LLMChatParams): Promise<LLMChatResponse> {
34 return this.responseProvider(params);
35 }
36}
37
38async function runWithLLM(llm: LLM): Promise<{
39 sink: CollectingSink;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected