Class OpenAIProvider

java.lang.Object
ai.singlr.openai.OpenAIProvider
All Implemented Interfaces:
ai.singlr.core.model.ModelProvider

public class OpenAIProvider extends Object implements ai.singlr.core.model.ModelProvider
ModelProvider implementation for OpenAI's Responses API.

Supports canonical OpenAI models (GPT-5.4, GPT-4.1, GPT-4o, o3, o4-mini) out of the box. When ModelConfig.baseUrl() is set — pointing at Azure OpenAI, an OpenAI-compatible proxy (LiteLLM, vLLM, Ollama), or Vertex AI — any non-blank modelId is accepted. The string is used verbatim as the model field in the request body, which Azure OpenAI maps to the deployment name. Context-window and max-output-tokens metadata default to 0 ("unknown") for unrecognised ids; callers can override output tokens via ModelConfig.Builder.withMaxOutputTokens(Integer).

  • Constructor Details

  • Method Details

    • name

      public String name()
      Specified by:
      name in interface ai.singlr.core.model.ModelProvider
    • create

      public ai.singlr.core.model.Model create(String modelId, ai.singlr.core.model.ModelConfig config)
      Specified by:
      create in interface ai.singlr.core.model.ModelProvider
    • supports

      public boolean supports(String modelId)
      Specified by:
      supports in interface ai.singlr.core.model.ModelProvider