Skip to main content

create_provider

Function create_provider 

Source
pub fn create_provider(name: &str) -> Result<Arc<dyn Provider>, ConversionError>
Expand description

Create a provider by name using the static registry.

Supports both exact names and aliases (e.g., “moonshot” -> “kimi”).

When the provider name is not found in the registry, falls back to [DefaultProvider] which makes minimal assumptions about the provider (standard OpenAI-compatible Chat API format). This allows any Chinese LLM provider not explicitly registered to work out of the box.