Skip to content

AI Providers

Currently the framework supports the following AI providers:

  • OpenAI: GPT
  • Anthropic: Claude
  • Google: Gemini
  • OCI: Oracle Cloud Infrastructure
  • xAI: Grok
  • Mistral: Mistral Large/Medium/Small, Magistral, Codestral
  • Ollama: Open source models (Llama, Mistral, Qwen, and more)
  • OpenRouter: Unified API for 300+ models from multiple providers

You can switch between providers without a change to your code. Each provider has its own package. All of these packages give the same interface for text generation and function calling.

The p_provider parameter of uc_ai.generate_text selects the provider. For example:

DECLARE
l_result JSON_OBJECT_T;
BEGIN
-- openai example
l_result := uc_ai.generate_text(
p_user_prompt => 'What is APEX Office Print?',
p_provider => uc_ai.c_provider_openai,
p_model => uc_ai_openai.c_model_gpt_5_6_luna
);
DBMS_OUTPUT.PUT_LINE('OpenAI Response: '
|| l_result.get_string('final_message'));
-- anthropic example
l_result := uc_ai.generate_text(
p_user_prompt => 'What is APEX Office Print?',
p_provider => uc_ai.c_provider_anthropic,
p_model => uc_ai_anthropic.c_model_claude_4_5_haiku
);
DBMS_OUTPUT.PUT_LINE('Anthropic Response: '
|| l_result.get_string('final_message'));
-- google example
l_result := uc_ai.generate_text(
p_user_prompt => 'What is APEX Office Print?',
p_provider => uc_ai.c_provider_google,
p_model => uc_ai_google.c_model_gemini_3_7_flash
);
DBMS_OUTPUT.PUT_LINE('Google Response: '
|| l_result.get_string('final_message'));
END;
/

Each provider has its own package. All of these packages have the same interface:

  • OpenAI: uc_ai_openai
  • Anthropic: uc_ai_anthropic
  • Google: uc_ai_google
  • xAI: uc_ai_xai
  • Ollama: uc_ai_ollama
  • Mistral: Uses uc_ai_openai (OpenAI-compatible API)
  • OpenRouter: Uses uc_ai_openai (OpenAI-compatible API)

The packages hide the API differences between the providers. You can therefore change the provider with little work.

We plan to add more providers. You are welcome to contribute a new provider package, or an improvement to an existing one. Follow the same interface conventions as the current packages.

The tests directory shows how we build the tests for the providers. Each provider has its own test suite. The suite tests text generation and function calling.