Search documentation of Ragex

# Ragex.AI.Provider.Registry (Ragex v0.4.0)

View Source

Registry for AI providers.

Manages registration, discovery, and selection of AI providers.

## Summary

### Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

current()

Get current active provider from config

get(provider_name)

Get provider by name

get_provider(provider_name)

Get provider module by name.

list()

List all registered providers

register(provider_name, provider_module)

Register a provider module

start_link(opts \\ [])

## Functions

# child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# current()

Get current active provider from config

# get(provider_name)

Get provider by name

# get_provider(provider_name)

    @spec get_provider(atom()) :: {:ok, module()} | {:error, :not_found}

Get provider module by name.

Alias for `get/1` with more explicit naming.

## Parameters

- `provider_name`: Provider identifier atom (e.g., `:deepseek_r1`, `:openai`, `:anthropic`)

## Returns

- `{:ok, module}` - Provider module if registered
- `{:error, :not_found}` - Provider not found in registry

## Examples

    iex> Registry.get_provider(:deepseek_r1)
    {:ok, Ragex.AI.Provider.DeepSeekR1}

    iex> Registry.get_provider(:unknown)
    {:error, :not_found}

# list()

List all registered providers

# register(provider_name, provider_module)

Register a provider module

# start_link(opts \\ [])