@providerprotocol/ai
@providerprotocol/ai / @providerprotocol/ai
@providerprotocol/ai
Section titled “@providerprotocol/ai”Fileoverview
Section titled “Fileoverview”Unified Provider Protocol (UPP) - A unified interface for AI model inference
UPP provides a consistent API for interacting with multiple AI providers including Anthropic, OpenAI, Google, Ollama, OpenRouter, and xAI. The library handles provider-specific transformations, streaming, tool execution, and error handling.
Classes
Section titled “Classes”Interfaces
Section titled “Interfaces”- AfterCallResult
- AudioBlock
- BeforeCallResult
- BinaryBlock
- BoundEmbeddingModel
- BoundImageModel
- BoundLLMModel
- DocumentBlock
- Embedding
- EmbeddingHandler
- EmbeddingInstance
- EmbeddingModelInput
- EmbeddingOptions
- EmbeddingProgress
- EmbeddingRequest
- EmbeddingResponse
- EmbeddingResult
- EmbeddingStream
- EmbeddingUsage
- EmbeddingVector
- EmbedOptions
- EventDelta
- ExponentialBackoffOptions
- GeneratedImage
- ImageBlock
- ImageCapabilities
- ImageEditInput
- ImageEditRequest
- ImageGenerateOptions
- ImageHandler
- ImageInstance
- ImageModelInput
- ImageOptions
- ImageProviderStreamResult
- ImageRequest
- ImageResponse
- ImageResult
- ImageStreamResult
- ImageUsage
- JSONSchema
- JSONSchemaProperty
- KeyStrategy
- LinearBackoffOptions
- LLMCapabilities
- LLMHandler
- LLMInstance
- LLMOptions
- LLMRequest
- LLMResponse
- LLMStreamResult
- MessageMetadata
- MessageOptions
- Middleware
- MiddlewareContext
- ModelReference
- Provider
- ProviderConfig
- ProviderIdentity
- ReasoningBlock
- RetryAfterStrategyOptions
- RetryStrategy
- StreamContext
- StreamEvent
- StreamResult
- TextBlock
- TokenUsage
- Tool
- ToolCall
- ToolExecution
- ToolInput
- ToolMetadata
- ToolResult
- ToolUseStrategy
- Turn
- VideoBlock
- ZodV3Like
- ZodV4Like
Type Aliases
Section titled “Type Aliases”- AnyRequest
- AnyResponse
- AssistantContent
- ContentBlock
- ContentBlockType
- DocumentSource
- DocumentSourceType
- EmbeddingInput
- EmbeddingInputType
- EmbeddingProvider
- ErrorCode
- ImageInput
- ImageProvider
- ImageSource
- ImageSourceType
- ImageStreamEvent
- InferenceInput
- JSONSchemaPropertyType
- LLMProvider
- MessageJSON
- MessageRole
- MessageType
- MiddlewareModality
- Modality
- ModalityType
- StreamEventType
- Structure
- ThreadJSON
- TurnJSON
- UserContent
- ZodLike
Variables
Section titled “Variables”- ai
- ContentBlockType
- DocumentSourceType
- EmbeddingInputType
- ErrorCode
- ImageSourceType
- MessageRole
- ModalityType
- StreamEventType
Functions
Section titled “Functions”- aggregateUsage
- contentBlockStart
- contentBlockStop
- createProvider
- createStreamResult
- createTurn
- dynamicKey
- embedding
- emptyUsage
- exponentialBackoff
- image
- isAssistantMessage
- isAudioBlock
- isBinaryBlock
- isDocumentBlock
- isImageBlock
- isReasoningBlock
- isTextBlock
- isToolResultMessage
- isUserMessage
- isVideoBlock
- linearBackoff
- llm
- messageStart
- messageStop
- noRetry
- objectDelta
- reasoning
- retryAfterStrategy
- roundRobinKeys
- text
- textDelta
- toolCallDelta
- toolExecutionEnd
- toolExecutionStart
- weightedKeys