Auto-detects and uses the best available embedding provider with the following priority:
Ollama (free, local, fast) - if running
sentence-transformers (local Python) - if Python environment is set up
OpenAI API - if OPENAI_API_KEY is set
Gemini API - if GEMINI_API_KEY is set
Arguments
- texts
Character vector of texts to embed
- provider
Character string: "auto" (default), "ollama", "sentence-transformers", "openai", or "gemini". Use "auto" for automatic detection.
- model
Character string specifying the embedding model. If NULL, uses default model for the selected provider.
- api_key
Optional API key for OpenAI or Gemini providers. If NULL, falls back to environment variables (OPENAI_API_KEY, GEMINI_API_KEY).
- verbose
Logical, whether to print progress messages (default: TRUE)
