API / @aihu/ai

@aihu/ai

Agents & governance

Thin adapters from AI SDK stream types to ReadableStream<string> for aihu $stream collections.

version
0.1.0
exports
4
values
4
types
0
01

fromAnthropic

functionagent
function fromAnthropic(stream: AsyncIterable<MessageStreamEvent>): ReadableStream<string>
02

fromGemini

functionagent
function fromGemini( stream: AsyncIterable<GenerateContentStreamResult>, ): ReadableStream<string>
03

fromOpenAI

functionagent
function fromOpenAI(stream: AsyncIterable<ChatCompletionChunk>): ReadableStream<string>
04

fromResponse

functionagent
function fromResponse(res: Response): ReadableStream<string>

`fromResponse` — adapter from `fetch()` Response to `ReadableStream<string>`.