UNPKG

agentfootprint

Version:

The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.

61 lines • 3.94 kB
/** * LLM provider adapters — implementation behind the `agentfootprint/providers` * subpath (which re-exports this file). * * The standalone `agentfootprint/providers` subpath alias was removed in 4.0.0. * Import from the canonical subpath: * * import { mock, anthropic, openai } from 'agentfootprint/providers'; * * Pattern: Adapter (GoF) — concrete `LLMProvider` implementations that * translate the agentfootprint port to a specific vendor SDK. * Role: Outer ring (Hexagonal). Swappable at runtime; the Agent * knows nothing about vendor specifics. * * What's here today: * • `mock` / `MockProvider` — deterministic + realistic-mode mock * • `ollama` / `OllamaProvider` — local models, free, no API key * • `anthropic` / `AnthropicProvider` — real provider (Claude) * • `openai` / `OpenAIProvider` — real provider (GPT) * • `gemini` / `GeminiProvider` — Gemini on Vertex or the Gemini API * • `bedrock`, `azureOpenai`, and the `browser*` variants * • `foundry` / `foundryLocal` — Microsoft Foundry: a project endpoint in * the cloud (Entra or key), and the on-device Foundry Local service * * The ladder these are FOR: `mock()` while you shape the logic → * `ollama('<model>')` for a real model that costs nothing and needs no * key → a paid API in production. The agent code above them does not * change between the three; that is the whole point of the port. * * Bring your own (BYO): * For Cohere / on-prem / fine-tuned models, implement the * `LLMProvider` interface (see `LLMProvider` exported from the main * barrel) — `complete()` is required, `stream()` is optional. The * `MockProvider` source is the canonical reference. */ export { forcedToolChoiceFor, UnsupportedToolChoiceError, } from './provider-contract/forcedToolChoice.js'; export { nativeOutputSchemaFor, UnsupportedNativeOutputError, } from './provider-contract/nativeOutputSchema.js'; export { UnsafeThinkingReplayError } from './thinking/replay.js'; export { MockProvider, mock, } from './adapters/llm/MockProvider.js'; export { anthropic, AnthropicProvider, } from './adapters/llm/AnthropicProvider.js'; export { openai, OpenAIProvider, azureOpenai, } from './adapters/llm/OpenAIProvider.js'; export { ollama, OllamaProvider, OllamaUnavailableError, } from './adapters/llm/OllamaProvider.js'; // Microsoft Foundry, both doors (9.74.0). `foundry()` speaks a PROJECT // endpoint's `/openai/v1` route — deployment name as the model, Entra // credential or key as the auth; the hosted platform injects // FOUNDRY_PROJECT_ENDPOINT so a deployed container needs zero config. // `entraBearerToken` is deliberately NOT re-exported: it is the two Entra // doors' shared plumbing, not a promise; vend tokens through // `entraIdentity` (agentfootprint/security) instead. export { foundry, foundryInferenceUrl, } from './adapters/llm/FoundryProvider.js'; // Foundry Local: the on-device service. Fetch-only like `ollama()` — the // service's own OpenAI-compatible `/v1` is the wire, the typed refusal // carries the fix (`foundry server start` / `status`; the port is dynamic). export { foundryLocal, FoundryLocalProvider, FoundryLocalUnavailableError, } from './adapters/llm/FoundryLocalProvider.js'; export { bedrock, BedrockProvider, } from './adapters/llm/BedrockProvider.js'; export { gemini, GeminiProvider, } from './adapters/llm/GeminiProvider.js'; export { browserAnthropic, BrowserAnthropicProvider, } from './adapters/llm/BrowserAnthropicProvider.js'; export { invokeModelGateway, InvokeModelGatewayProvider, InvokeModelGatewayError, } from './adapters/llm/InvokeModelGatewayProvider.js'; export { browserOpenai, BrowserOpenAIProvider, browserAzureOpenai, BrowserAzureOpenAIProvider, } from './adapters/llm/BrowserOpenAIProvider.js'; export { createProvider, } from './adapters/llm/createProvider.js'; //# sourceMappingURL=providers.js.map