@yourgpt/llm-sdk 2.6.0-beta.2 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +87 -17
  3. package/dist/adapters/index.d.mts +11 -13
  4. package/dist/adapters/index.d.ts +11 -13
  5. package/dist/adapters/index.js +406 -114
  6. package/dist/adapters/index.mjs +406 -114
  7. package/dist/audio-K-Z3-Bce.d.mts +191 -0
  8. package/dist/audio-K-Z3-Bce.d.ts +191 -0
  9. package/dist/{base-BICaQaRS.d.mts → base-6LzczuCg.d.ts} +8 -1
  10. package/dist/{base-CpRPB8u8.d.ts → base-DySbTP8C.d.mts} +8 -1
  11. package/dist/decisions-CJzOt87t.d.mts +137 -0
  12. package/dist/decisions-CJzOt87t.d.ts +137 -0
  13. package/dist/fallback/index.d.mts +4 -4
  14. package/dist/fallback/index.d.ts +4 -4
  15. package/dist/http-BQxUT5A9.d.mts +9 -0
  16. package/dist/http-BQxUT5A9.d.ts +9 -0
  17. package/dist/index.d.mts +17 -9
  18. package/dist/index.d.ts +17 -9
  19. package/dist/index.js +698 -205
  20. package/dist/index.mjs +695 -206
  21. package/dist/providers/anthropic/index.d.mts +7 -4
  22. package/dist/providers/anthropic/index.d.ts +7 -4
  23. package/dist/providers/anthropic/index.js +389 -115
  24. package/dist/providers/anthropic/index.mjs +389 -115
  25. package/dist/providers/azure/index.d.mts +3 -3
  26. package/dist/providers/azure/index.d.ts +3 -3
  27. package/dist/providers/cloudflare/index.d.mts +11 -0
  28. package/dist/providers/cloudflare/index.d.ts +11 -0
  29. package/dist/providers/cloudflare/index.js +743 -0
  30. package/dist/providers/cloudflare/index.mjs +741 -0
  31. package/dist/providers/fireworks/index.d.mts +3 -3
  32. package/dist/providers/fireworks/index.d.ts +3 -3
  33. package/dist/providers/fireworks/index.js +181 -60
  34. package/dist/providers/fireworks/index.mjs +181 -60
  35. package/dist/providers/google/index.d.mts +3 -3
  36. package/dist/providers/google/index.d.ts +3 -3
  37. package/dist/providers/google/index.js +181 -60
  38. package/dist/providers/google/index.mjs +181 -60
  39. package/dist/providers/ollama/index.d.mts +4 -4
  40. package/dist/providers/ollama/index.d.ts +4 -4
  41. package/dist/providers/openai/index.d.mts +38 -6
  42. package/dist/providers/openai/index.d.ts +38 -6
  43. package/dist/providers/openai/index.js +1451 -85
  44. package/dist/providers/openai/index.mjs +1449 -86
  45. package/dist/providers/openrouter/index.d.mts +21 -4
  46. package/dist/providers/openrouter/index.d.ts +21 -4
  47. package/dist/providers/openrouter/index.js +1040 -131
  48. package/dist/providers/openrouter/index.mjs +1040 -132
  49. package/dist/providers/togetherai/index.d.mts +3 -3
  50. package/dist/providers/togetherai/index.d.ts +3 -3
  51. package/dist/providers/togetherai/index.js +181 -60
  52. package/dist/providers/togetherai/index.mjs +181 -60
  53. package/dist/providers/typesafe/index.d.mts +8 -0
  54. package/dist/providers/typesafe/index.d.ts +8 -0
  55. package/dist/providers/typesafe/index.js +735 -0
  56. package/dist/providers/typesafe/index.mjs +733 -0
  57. package/dist/providers/xai/index.d.mts +3 -3
  58. package/dist/providers/xai/index.d.ts +3 -3
  59. package/dist/providers/xai/index.js +181 -60
  60. package/dist/providers/xai/index.mjs +181 -60
  61. package/dist/{types-DCFqkJAy.d.ts → types-B0y6VZSQ.d.ts} +1 -1
  62. package/dist/{types-DHQEMFHA.d.mts → types-BXQMtaCX.d.ts} +17 -3
  63. package/dist/{types-C3RgRbEC.d.mts → types-BY6BVhFg.d.mts} +1 -1
  64. package/dist/{types-Dikj3En4.d.ts → types-C7_qVSSd.d.mts} +17 -3
  65. package/dist/{types-Dg1Bcg1k.d.mts → types-D7lzMMLu.d.mts} +13 -1
  66. package/dist/{types-Dg1Bcg1k.d.ts → types-D7lzMMLu.d.ts} +13 -1
  67. package/dist/yourgpt/index.d.mts +1 -1
  68. package/dist/yourgpt/index.d.ts +1 -1
  69. package/docs/decisions.md +174 -0
  70. package/docs/media.md +201 -0
  71. package/docs/multimodal-and-audio.md +9 -2
  72. package/package.json +34 -12
  73. package/dist/audio-BBSwnjo8.d.mts +0 -92
  74. package/dist/audio-BBSwnjo8.d.ts +0 -92
@@ -1,7 +1,7 @@
1
- import { L as LLMAdapter } from '../base-BICaQaRS.mjs';
2
- import { F as FallbackChainConfig, c as FallbackFailure, R as RoutingStore } from '../types-C3RgRbEC.mjs';
3
- export { d as FallbackInfo, b as RetryBackoff, e as RetryInfo, a as RoutingStrategy } from '../types-C3RgRbEC.mjs';
4
- import '../types-Dg1Bcg1k.mjs';
1
+ import { L as LLMAdapter } from '../base-DySbTP8C.mjs';
2
+ import { F as FallbackChainConfig, c as FallbackFailure, R as RoutingStore } from '../types-BY6BVhFg.mjs';
3
+ export { d as FallbackInfo, b as RetryBackoff, e as RetryInfo, a as RoutingStrategy } from '../types-BY6BVhFg.mjs';
4
+ import '../types-D7lzMMLu.mjs';
5
5
  import 'zod';
6
6
 
7
7
  /**
@@ -1,7 +1,7 @@
1
- import { L as LLMAdapter } from '../base-CpRPB8u8.js';
2
- import { F as FallbackChainConfig, c as FallbackFailure, R as RoutingStore } from '../types-DCFqkJAy.js';
3
- export { d as FallbackInfo, b as RetryBackoff, e as RetryInfo, a as RoutingStrategy } from '../types-DCFqkJAy.js';
4
- import '../types-Dg1Bcg1k.js';
1
+ import { L as LLMAdapter } from '../base-6LzczuCg.js';
2
+ import { F as FallbackChainConfig, c as FallbackFailure, R as RoutingStore } from '../types-B0y6VZSQ.js';
3
+ export { d as FallbackInfo, b as RetryBackoff, e as RetryInfo, a as RoutingStrategy } from '../types-B0y6VZSQ.js';
4
+ import '../types-D7lzMMLu.js';
5
5
  import 'zod';
6
6
 
7
7
  /**
@@ -0,0 +1,9 @@
1
+ interface DecisionProviderOptions {
2
+ apiKey?: string;
3
+ /** API root, not a chat endpoint. Defaults depend on the provider. */
4
+ baseUrl?: string;
5
+ fetch?: typeof globalThis.fetch;
6
+ headers?: Record<string, string>;
7
+ }
8
+
9
+ export type { DecisionProviderOptions as D };
@@ -0,0 +1,9 @@
1
+ interface DecisionProviderOptions {
2
+ apiKey?: string;
3
+ /** API root, not a chat endpoint. Defaults depend on the provider. */
4
+ baseUrl?: string;
5
+ fetch?: typeof globalThis.fetch;
6
+ headers?: Record<string, string>;
7
+ }
8
+
9
+ export type { DecisionProviderOptions as D };
package/dist/index.d.mts CHANGED
@@ -1,14 +1,15 @@
1
- import { G as GenerateTextParams, a as GenerateTextResult, S as StreamTextParams, b as StreamTextResult, T as ToolContext, c as ToolModelOutput, d as Tool, A as ActionDefinition, e as ToolDefinition, f as ToolProfile, K as KnowledgeBaseConfig, W as WebSearchConfig, g as StorageAdapter, P as ProviderMetadata, O as OpenAITransportOptions, h as OpenAIReasoningEffort, R as ResponseFormat, D as DoneEventMessage, i as StreamEvent, j as ToolCallInfo, k as TokenUsageRaw, l as ProviderToolRuntimeOptions, M as Message, m as ToolResponse, n as StorageMessage } from './types-Dg1Bcg1k.mjs';
2
- export { a8 as AnthropicProviderToolOptions, a5 as AnthropicToolSelectionHints, s as AssistantMessage, a9 as Citation, C as CoreMessage, _ as DEFAULT_CAPABILITIES, p as DoGenerateParams, q as DoGenerateResult, Q as ErrorChunk, F as FilePart, N as FinishChunk, X as FinishReason, y as GenerateStep, I as ImagePart, $ as LLMConfig, L as LanguageModel, o as ModelCapabilities, a7 as OpenAIProviderToolOptions, ab as OpenAIResponseItem, ac as OpenAIResponseMetadata, aa as OpenAIResponsesOptions, a4 as OpenAIToolSelectionHints, Y as ResponseOptions, Z as StorageFile, B as StreamChunk, z as StreamPart, r as SystemMessage, E as TextDeltaChunk, v as TextPart, V as TokenUsage, w as ToolCall, H as ToolCallChunk, a3 as ToolExecution, a0 as ToolLocation, t as ToolMessage, a6 as ToolNativeProviderHints, ad as ToolOutputPart, x as ToolResult, J as ToolResultChunk, a1 as UnifiedToolCall, a2 as UnifiedToolResult, u as UserContentPart, U as UserMessage } from './types-Dg1Bcg1k.mjs';
1
+ import { G as GenerateTextParams, a as GenerateTextResult, S as StreamTextParams, b as StreamTextResult, T as ToolContext, c as ToolModelOutput, d as Tool, A as ActionDefinition, e as ToolDefinition, f as ToolProfile, K as KnowledgeBaseConfig, W as WebSearchConfig, g as StorageAdapter, P as ProviderMetadata, O as OpenAITransportOptions, h as OpenAIReasoningEffort, R as ResponseFormat, D as DoneEventMessage, i as StreamEvent, j as ToolCallInfo, k as TokenUsageRaw, l as ProviderToolRuntimeOptions, M as Message, m as ToolResponse, n as StorageMessage } from './types-D7lzMMLu.mjs';
2
+ export { a8 as AnthropicProviderToolOptions, a5 as AnthropicToolSelectionHints, s as AssistantMessage, a9 as Citation, C as CoreMessage, _ as DEFAULT_CAPABILITIES, p as DoGenerateParams, q as DoGenerateResult, Q as ErrorChunk, F as FilePart, N as FinishChunk, X as FinishReason, y as GenerateStep, I as ImagePart, $ as LLMConfig, L as LanguageModel, o as ModelCapabilities, a7 as OpenAIProviderToolOptions, ab as OpenAIResponseItem, ac as OpenAIResponseMetadata, aa as OpenAIResponsesOptions, a4 as OpenAIToolSelectionHints, Y as ResponseOptions, Z as StorageFile, B as StreamChunk, z as StreamPart, r as SystemMessage, E as TextDeltaChunk, v as TextPart, V as TokenUsage, w as ToolCall, H as ToolCallChunk, a3 as ToolExecution, a0 as ToolLocation, t as ToolMessage, a6 as ToolNativeProviderHints, ad as ToolOutputPart, x as ToolResult, J as ToolResultChunk, a1 as UnifiedToolCall, a2 as UnifiedToolResult, u as UserContentPart, U as UserMessage } from './types-D7lzMMLu.mjs';
3
+ export { A as AudioAPIError, o as AudioResponseMetadata, p as AudioWarning, G as GeneratedImage, k as GeneratedSpeech, I as ImageFile, c as ImageModel, a as ImageOptions, b as ImageResult, M as MediaAPIError, e as RealtimeClientSecret, f as RealtimeModel, d as RealtimeSessionOptions, R as RealtimeToolDefinition, m as SpeechFormat, S as SpeechModel, i as SpeechOptions, n as TranscriptSegment, T as TranscriptionModel, j as TranscriptionOptions, l as TranscriptionResult, g as generateImage, h as generateSpeech, t as transcribe } from './audio-K-Z3-Bce.mjs';
4
+ export { D as DecisionAPIError, h as DecisionAnswer, k as DecisionErrorCode, f as DecisionImage, b as DecisionInput, a as DecisionJSON, j as DecisionModel, g as DecisionOptions, c as DecisionQuestion, d as DecisionQuestions, i as DecisionResult, e as experimental_decide } from './decisions-CJzOt87t.mjs';
3
5
  import { z } from 'zod';
4
- import { A as AIProvider } from './types-DHQEMFHA.mjs';
5
- export { a as AnthropicProviderConfig, f as AnthropicTool, h as AnthropicToolResult, g as AnthropicToolUse, b as AzureProviderConfig, B as BaseProviderConfig, m as GeminiFunctionCall, l as GeminiFunctionDeclaration, n as GeminiFunctionResponse, G as GoogleProviderConfig, d as OllamaModelOptions, c as OllamaProviderConfig, O as OpenAIProviderConfig, i as OpenAITool, j as OpenAIToolCall, k as OpenAIToolResult, P as ProviderCapabilities, e as ProviderFormatter, X as XAIProviderConfig } from './types-DHQEMFHA.mjs';
6
- import { L as LLMAdapter } from './base-BICaQaRS.mjs';
7
- export { A as AdapterFactory, C as ChatCompletionRequest } from './base-BICaQaRS.mjs';
6
+ import { A as AIProvider } from './types-C7_qVSSd.mjs';
7
+ export { a as AnthropicProviderConfig, f as AnthropicTool, h as AnthropicToolResult, g as AnthropicToolUse, b as AzureProviderConfig, B as BaseProviderConfig, m as GeminiFunctionCall, l as GeminiFunctionDeclaration, n as GeminiFunctionResponse, G as GoogleProviderConfig, d as OllamaModelOptions, c as OllamaProviderConfig, O as OpenAIProviderConfig, i as OpenAITool, j as OpenAIToolCall, k as OpenAIToolResult, P as ProviderCapabilities, e as ProviderFormatter, X as XAIProviderConfig } from './types-C7_qVSSd.mjs';
8
+ import { L as LLMAdapter } from './base-DySbTP8C.mjs';
9
+ export { A as AdapterFactory, C as ChatCompletionRequest } from './base-DySbTP8C.mjs';
8
10
  import * as hono from 'hono';
9
11
  import { Hono } from 'hono';
10
- export { F as FallbackChainConfig, c as FallbackFailure, d as FallbackInfo, b as RetryBackoff, e as RetryInfo, R as RoutingStore, a as RoutingStrategy } from './types-C3RgRbEC.mjs';
11
- export { A as AudioAPIError, f as AudioResponseMetadata, h as AudioWarning, G as GeneratedSpeech, d as SpeechFormat, S as SpeechModel, a as SpeechOptions, e as TranscriptSegment, T as TranscriptionModel, b as TranscriptionOptions, c as TranscriptionResult, g as generateSpeech, t as transcribe } from './audio-BBSwnjo8.mjs';
12
+ export { F as FallbackChainConfig, c as FallbackFailure, d as FallbackInfo, b as RetryBackoff, e as RetryInfo, R as RoutingStore, a as RoutingStrategy } from './types-BY6BVhFg.mjs';
12
13
 
13
14
  /**
14
15
  * generateText - Generate text using a language model
@@ -565,6 +566,11 @@ interface StreamResultConstructorOptions {
565
566
  * Collected result after consuming the stream
566
567
  */
567
568
  interface CollectedResult {
569
+ /** Terminal provider/runtime failure, also retained in events. */
570
+ error?: {
571
+ message: string;
572
+ code?: string;
573
+ };
568
574
  /** Accumulated text content */
569
575
  text: string;
570
576
  /** All messages from the stream (for persistence) */
@@ -1166,7 +1172,9 @@ declare function formatSSEData(event: StreamEvent): string;
1166
1172
  /**
1167
1173
  * Create a ReadableStream from an async generator of events
1168
1174
  */
1169
- declare function createEventStream(generator: AsyncGenerator<StreamEvent>): ReadableStream<Uint8Array>;
1175
+ declare function createEventStream(generator: AsyncGenerator<StreamEvent>, options?: {
1176
+ includeUsage?: boolean;
1177
+ }): ReadableStream<Uint8Array>;
1170
1178
  /**
1171
1179
  * Create SSE Response object
1172
1180
  */
package/dist/index.d.ts CHANGED
@@ -1,14 +1,15 @@
1
- import { G as GenerateTextParams, a as GenerateTextResult, S as StreamTextParams, b as StreamTextResult, T as ToolContext, c as ToolModelOutput, d as Tool, A as ActionDefinition, e as ToolDefinition, f as ToolProfile, K as KnowledgeBaseConfig, W as WebSearchConfig, g as StorageAdapter, P as ProviderMetadata, O as OpenAITransportOptions, h as OpenAIReasoningEffort, R as ResponseFormat, D as DoneEventMessage, i as StreamEvent, j as ToolCallInfo, k as TokenUsageRaw, l as ProviderToolRuntimeOptions, M as Message, m as ToolResponse, n as StorageMessage } from './types-Dg1Bcg1k.js';
2
- export { a8 as AnthropicProviderToolOptions, a5 as AnthropicToolSelectionHints, s as AssistantMessage, a9 as Citation, C as CoreMessage, _ as DEFAULT_CAPABILITIES, p as DoGenerateParams, q as DoGenerateResult, Q as ErrorChunk, F as FilePart, N as FinishChunk, X as FinishReason, y as GenerateStep, I as ImagePart, $ as LLMConfig, L as LanguageModel, o as ModelCapabilities, a7 as OpenAIProviderToolOptions, ab as OpenAIResponseItem, ac as OpenAIResponseMetadata, aa as OpenAIResponsesOptions, a4 as OpenAIToolSelectionHints, Y as ResponseOptions, Z as StorageFile, B as StreamChunk, z as StreamPart, r as SystemMessage, E as TextDeltaChunk, v as TextPart, V as TokenUsage, w as ToolCall, H as ToolCallChunk, a3 as ToolExecution, a0 as ToolLocation, t as ToolMessage, a6 as ToolNativeProviderHints, ad as ToolOutputPart, x as ToolResult, J as ToolResultChunk, a1 as UnifiedToolCall, a2 as UnifiedToolResult, u as UserContentPart, U as UserMessage } from './types-Dg1Bcg1k.js';
1
+ import { G as GenerateTextParams, a as GenerateTextResult, S as StreamTextParams, b as StreamTextResult, T as ToolContext, c as ToolModelOutput, d as Tool, A as ActionDefinition, e as ToolDefinition, f as ToolProfile, K as KnowledgeBaseConfig, W as WebSearchConfig, g as StorageAdapter, P as ProviderMetadata, O as OpenAITransportOptions, h as OpenAIReasoningEffort, R as ResponseFormat, D as DoneEventMessage, i as StreamEvent, j as ToolCallInfo, k as TokenUsageRaw, l as ProviderToolRuntimeOptions, M as Message, m as ToolResponse, n as StorageMessage } from './types-D7lzMMLu.js';
2
+ export { a8 as AnthropicProviderToolOptions, a5 as AnthropicToolSelectionHints, s as AssistantMessage, a9 as Citation, C as CoreMessage, _ as DEFAULT_CAPABILITIES, p as DoGenerateParams, q as DoGenerateResult, Q as ErrorChunk, F as FilePart, N as FinishChunk, X as FinishReason, y as GenerateStep, I as ImagePart, $ as LLMConfig, L as LanguageModel, o as ModelCapabilities, a7 as OpenAIProviderToolOptions, ab as OpenAIResponseItem, ac as OpenAIResponseMetadata, aa as OpenAIResponsesOptions, a4 as OpenAIToolSelectionHints, Y as ResponseOptions, Z as StorageFile, B as StreamChunk, z as StreamPart, r as SystemMessage, E as TextDeltaChunk, v as TextPart, V as TokenUsage, w as ToolCall, H as ToolCallChunk, a3 as ToolExecution, a0 as ToolLocation, t as ToolMessage, a6 as ToolNativeProviderHints, ad as ToolOutputPart, x as ToolResult, J as ToolResultChunk, a1 as UnifiedToolCall, a2 as UnifiedToolResult, u as UserContentPart, U as UserMessage } from './types-D7lzMMLu.js';
3
+ export { A as AudioAPIError, o as AudioResponseMetadata, p as AudioWarning, G as GeneratedImage, k as GeneratedSpeech, I as ImageFile, c as ImageModel, a as ImageOptions, b as ImageResult, M as MediaAPIError, e as RealtimeClientSecret, f as RealtimeModel, d as RealtimeSessionOptions, R as RealtimeToolDefinition, m as SpeechFormat, S as SpeechModel, i as SpeechOptions, n as TranscriptSegment, T as TranscriptionModel, j as TranscriptionOptions, l as TranscriptionResult, g as generateImage, h as generateSpeech, t as transcribe } from './audio-K-Z3-Bce.js';
4
+ export { D as DecisionAPIError, h as DecisionAnswer, k as DecisionErrorCode, f as DecisionImage, b as DecisionInput, a as DecisionJSON, j as DecisionModel, g as DecisionOptions, c as DecisionQuestion, d as DecisionQuestions, i as DecisionResult, e as experimental_decide } from './decisions-CJzOt87t.js';
3
5
  import { z } from 'zod';
4
- import { A as AIProvider } from './types-Dikj3En4.js';
5
- export { a as AnthropicProviderConfig, f as AnthropicTool, h as AnthropicToolResult, g as AnthropicToolUse, b as AzureProviderConfig, B as BaseProviderConfig, m as GeminiFunctionCall, l as GeminiFunctionDeclaration, n as GeminiFunctionResponse, G as GoogleProviderConfig, d as OllamaModelOptions, c as OllamaProviderConfig, O as OpenAIProviderConfig, i as OpenAITool, j as OpenAIToolCall, k as OpenAIToolResult, P as ProviderCapabilities, e as ProviderFormatter, X as XAIProviderConfig } from './types-Dikj3En4.js';
6
- import { L as LLMAdapter } from './base-CpRPB8u8.js';
7
- export { A as AdapterFactory, C as ChatCompletionRequest } from './base-CpRPB8u8.js';
6
+ import { A as AIProvider } from './types-BXQMtaCX.js';
7
+ export { a as AnthropicProviderConfig, f as AnthropicTool, h as AnthropicToolResult, g as AnthropicToolUse, b as AzureProviderConfig, B as BaseProviderConfig, m as GeminiFunctionCall, l as GeminiFunctionDeclaration, n as GeminiFunctionResponse, G as GoogleProviderConfig, d as OllamaModelOptions, c as OllamaProviderConfig, O as OpenAIProviderConfig, i as OpenAITool, j as OpenAIToolCall, k as OpenAIToolResult, P as ProviderCapabilities, e as ProviderFormatter, X as XAIProviderConfig } from './types-BXQMtaCX.js';
8
+ import { L as LLMAdapter } from './base-6LzczuCg.js';
9
+ export { A as AdapterFactory, C as ChatCompletionRequest } from './base-6LzczuCg.js';
8
10
  import * as hono from 'hono';
9
11
  import { Hono } from 'hono';
10
- export { F as FallbackChainConfig, c as FallbackFailure, d as FallbackInfo, b as RetryBackoff, e as RetryInfo, R as RoutingStore, a as RoutingStrategy } from './types-DCFqkJAy.js';
11
- export { A as AudioAPIError, f as AudioResponseMetadata, h as AudioWarning, G as GeneratedSpeech, d as SpeechFormat, S as SpeechModel, a as SpeechOptions, e as TranscriptSegment, T as TranscriptionModel, b as TranscriptionOptions, c as TranscriptionResult, g as generateSpeech, t as transcribe } from './audio-BBSwnjo8.js';
12
+ export { F as FallbackChainConfig, c as FallbackFailure, d as FallbackInfo, b as RetryBackoff, e as RetryInfo, R as RoutingStore, a as RoutingStrategy } from './types-B0y6VZSQ.js';
12
13
 
13
14
  /**
14
15
  * generateText - Generate text using a language model
@@ -565,6 +566,11 @@ interface StreamResultConstructorOptions {
565
566
  * Collected result after consuming the stream
566
567
  */
567
568
  interface CollectedResult {
569
+ /** Terminal provider/runtime failure, also retained in events. */
570
+ error?: {
571
+ message: string;
572
+ code?: string;
573
+ };
568
574
  /** Accumulated text content */
569
575
  text: string;
570
576
  /** All messages from the stream (for persistence) */
@@ -1166,7 +1172,9 @@ declare function formatSSEData(event: StreamEvent): string;
1166
1172
  /**
1167
1173
  * Create a ReadableStream from an async generator of events
1168
1174
  */
1169
- declare function createEventStream(generator: AsyncGenerator<StreamEvent>): ReadableStream<Uint8Array>;
1175
+ declare function createEventStream(generator: AsyncGenerator<StreamEvent>, options?: {
1176
+ includeUsage?: boolean;
1177
+ }): ReadableStream<Uint8Array>;
1170
1178
  /**
1171
1179
  * Create SSE Response object
1172
1180
  */