pub fn build_llm_provider(
provider: Provider,
api_key: Option<String>,
model: String,
ollama_url: String,
) -> AppResult<LlmProvider>Expand description
Builds an LLM provider configuration from CLI parameters.
Constructs the appropriate LlmProvider variant based on the
selected provider type. For cloud providers (OpenAI, Anthropic),
an API key is required.
§Arguments
provider- The LLM provider typeapi_key- Optional API key for cloud providersmodel- Model name to useollama_url- Base URL for Ollama server
§Returns
An LlmProvider configured for the selected provider.
§Errors
Returns an error if a cloud provider is selected without an API key.