@tanstack/ai
Version:
Type-safe TypeScript AI SDK for streaming chat, tool calling, agents, structured outputs, and multimodal generation.
17 lines (16 loc) • 937 B
TypeScript
import { ByokProvider } from './define-provider.js';
import { ProviderKeys } from './keyed.js';
import { ProviderId } from './providers.js';
/**
* Where `subagents.keys` finds a key: an object by provider id, or a function
* that gets the provider (a BYOK descriptor or an id) and returns its key.
*/
export type ProviderKeySource = Readonly<Record<ProviderId, string | null | undefined>> | ((provider: ByokProvider | ProviderId) => string | null | undefined | Promise<string | null | undefined>);
/**
* The `ctx.keys` of an agent: `keys`, else `fallback` (the keys of a parent
* agent), else each provider's `env` names. Not in `@tanstack/ai/byok`, so
* the client entry has no env access.
*/
export declare function providerKeys(keys?: ProviderKeySource, fallback?: ProviderKeys): ProviderKeys;
/** The `ctx.keys` of an agent with no keys set: each provider's `env` names. */
export declare const envProviderKeys: ProviderKeys;