Provides a helper to stream chat model responses and return the final text string.
// Source: https://github.com/moeru-ai/airi | License: MIT | Copyright 2024-PRESENT Neko Ayaka
// Provided via justclaw.it.com; keep this notice with the code.
import type { Conversation, StreamOptions } from '@proj-airi/core-agent'
import type { GenerationProvider } from '@proj-airi/provider-inference'
import { streamFrom } from '@proj-airi/core-agent'
/**
* Sends one conversation to a chat model and resolves to the complete reply text.
*
* Agents receive this function instead of a provider, so each runtime keeps its own request policy.
* For example, stage-ui passes its LLM store, which remembers provider compatibility.
*
* `tools` are the only tools of the request, for example an icon search. The provider adds none of its own, such as a
* web search. Text before a tool call onl
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key