agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
55 lines (54 loc) • 4.52 kB
TypeScript
/**
* 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 type { MessageReplay, ReplayPart, ReplayPreparation, ThinkingReplayOmission, ThinkingReplayReason, } from './thinking/replay.js';
export { MockProvider, mock, type MockProviderOptions, type MockReply, type LatencyMs, } from './adapters/llm/MockProvider.js';
export { anthropic, AnthropicProvider, type AnthropicProviderOptions, } from './adapters/llm/AnthropicProvider.js';
export { openai, OpenAIProvider, azureOpenai, type OpenAIProviderOptions, type AzureOpenAIProviderOptions, } from './adapters/llm/OpenAIProvider.js';
export { ollama, OllamaProvider, OllamaUnavailableError, type OllamaProviderOptions, type ThinkLevel, } from './adapters/llm/OllamaProvider.js';
export { foundry, foundryInferenceUrl, type FoundryProviderOptions, } from './adapters/llm/FoundryProvider.js';
export type { TokenCredentialLike, AccessTokenLike } from './adapters/identity/azure.js';
export { foundryLocal, FoundryLocalProvider, FoundryLocalUnavailableError, type FoundryLocalProviderOptions, } from './adapters/llm/FoundryLocalProvider.js';
export { bedrock, BedrockProvider, type BedrockProviderOptions, } from './adapters/llm/BedrockProvider.js';
export { gemini, GeminiProvider, type GeminiProviderOptions, type GeminiClientLike, type GeminiModelsLike, type GeminiGenerateParams, type GeminiGenerateConfig, type GeminiGenerateResponse, type GeminiUsageMetadata, type GeminiCandidate, type GeminiContent, type GeminiPart, type GeminiFunctionDeclaration, } from './adapters/llm/GeminiProvider.js';
export type { GoogleGenAIConnectionOptions } from './adapters/llm/googleGenAI.js';
export { browserAnthropic, BrowserAnthropicProvider, type BrowserAnthropicProviderOptions, } from './adapters/llm/BrowserAnthropicProvider.js';
export { invokeModelGateway, InvokeModelGatewayProvider, InvokeModelGatewayError, type InvokeModelGatewayOptions, type InvokeModelGatewayKey, type InvokeModelGatewayFetch, type InvokeModelGatewayErrorReason, } from './adapters/llm/InvokeModelGatewayProvider.js';
export { browserOpenai, BrowserOpenAIProvider, type BrowserOpenAIProviderOptions, browserAzureOpenai, BrowserAzureOpenAIProvider, type BrowserAzureOpenAIProviderOptions, } from './adapters/llm/BrowserOpenAIProvider.js';
export { createProvider, type ProviderKind, type CreateProviderOptions, } from './adapters/llm/createProvider.js';
export type { LLMProvider, LLMRequest, LLMResponse, LLMChunk, LLMMessage, LLMToolSchema, LLMCallHooks, ResilienceReport, } from './provider-contract/types.js';