Skip to main content

llm

TypeScript AI Agent
  • LLM - Configuration surface and an OpenAI-compatible base client.
  • Python parity with praisonaiagents/llm/llm.py LLM.__init__. Every constructor parameter of the Python class is accepted here and honoured:
    • Request-shaped options reach the Chat Completions body built by {
  • Transport-shaped options reach the client built by {
  • maxIter bounds the tool-calling loop in {
  • events are listeners invoked on request start/end, tool calls, errors and retries (Python: litellm callbacks + display callbacks).
  • failoverManager rotates credentials on retryable failures.
  • promptCaching, webFetch and claudeMemory emit the Anthropic-specific request shapes Python emits, and are rejected on models that cannot carry them rather than silently ignored.
  • auth resolves credentials from an object, a function or a registered named provider.

Import

Classes

LLMEvent

TypeScript LLMEvent class

LLMEventHooks

TypeScript LLMEventHooks class

LLMFailoverProfile

TypeScript LLMFailoverProfile class

LLMFailoverManager

TypeScript LLMFailoverManager class

LLMFailoverDecision

TypeScript LLMFailoverDecision class

ClaudeMemoryBackend

TypeScript ClaudeMemoryBackend class

LLMConfig

TypeScript LLMConfig class

LLMResponse

TypeScript LLMResponse class

LLM

TypeScript LLM class

LLMGenerateOptions

TypeScript LLMGenerateOptions class

LLMToolLoopOptions

TypeScript LLMToolLoopOptions class

LLMToolCallRecord

TypeScript LLMToolCallRecord class

LLMToolLoopResult

TypeScript LLMToolLoopResult class

LLMRequestOptions

TypeScript LLMRequestOptions class

BaseLLM

TypeScript BaseLLM class

Functions

classifyLLMError()

Function definition.

isAnthropicModel()

Function definition.

JS Providers

JS Providers CLI

JS Provider Registry