( xaiStream: AsyncIterable<ChatCompletionChunk>, onComplete?: (content: string, usage: CompletionUsage) => void )
| 7 | * Uses the shared OpenAI-compatible streaming utility. |
| 8 | */ |
| 9 | export function createReadableStreamFromXAIStream( |
| 10 | xaiStream: AsyncIterable<ChatCompletionChunk>, |
| 11 | onComplete?: (content: string, usage: CompletionUsage) => void |
| 12 | ): ReadableStream<Uint8Array> { |
| 13 | return createOpenAICompatibleStream(xaiStream, 'xAI', onComplete) |
| 14 | } |
| 15 | |
| 16 | /** |
| 17 | * Creates a response format payload for xAI requests with JSON schema. |
no test coverage detected