register_provider: Register a Provider Factory

View source: R/utils_registry.R

register_providerR Documentation

Register a Provider Factory

Description

Register an additional provider factory so it can be resolved through the default registry's provider:model syntax. Intended for companion packages (such as aisdk.providers) that ship OpenAI-compatible providers and register them from their .onLoad hook, e.g. aisdk::register_provider("deepseek", function() create_deepseek()).

Registration is load-order independent: the factory is replayed into the default registry whether it is registered before or after the registry is first built.

Usage

register_provider(id, factory)

Arguments

id

The provider ID (e.g. "deepseek").

factory

A zero-argument function returning a provider object, or a function of one argument (model_id) returning a language model.

Value

Invisibly TRUE.


aisdk documentation built on May 29, 2026, 9:07 a.m.