MCPcopy Create free account
hub / github.com/TanStack/ai / chatStream

Method chatStream

packages/ai/tests/extend-adapter.test.ts:92–111  ·  view source on GitHub ↗
(
    _options: TextOptions<ResolveProviderOptions<TModel>>,
  )

Source from the content-addressed store, hash-verified

90
91 /* eslint-disable @typescript-eslint/require-await */
92 async *chatStream(
93 _options: TextOptions<ResolveProviderOptions<TModel>>,
94 ): AsyncIterable<StreamChunk> {
95 yield {
96 type: EventType.TEXT_MESSAGE_CONTENT,
97 messageId: 'mock-id',
98 timestamp: Date.now(),
99 delta: 'Hello',
100 content: 'Hello',
101 model: this.model,
102 }
103 yield {
104 type: EventType.RUN_FINISHED,
105 runId: 'mock-id',
106 threadId: 'mock-thread',
107 timestamp: Date.now(),
108 finishReason: 'stop',
109 model: this.model,
110 }
111 }
112 /* eslint-enable @typescript-eslint/require-await */
113
114 /* eslint-disable @typescript-eslint/require-await */

Callers 3

streamModelResponseMethod · 0.45
summarizeMethod · 0.45
summarizeStreamMethod · 0.45

Calls 1

nowMethod · 0.80

Tested by

no test coverage detected