Provider Capabilities

Functions for querying and validating provider capabilities.

Each service endpoint declares which API features it supports. Request functions validate capabilities before dispatching, giving clear errors instead of HTTP 404s.

What "validate before dispatch" means

Validation comes in two strengths, and which one applies depends on the verb:

  • Platform and lifecycle verbs — files, vector stores, conversations, moderations, audio, batch, fine-tuning, containers, uploads, video, realtime, FIM, prefix completion, image edits — validate strictly. An endpoint that declares no capabilities at all is rejected, because these surfaces are OpenAI-shaped and a backend that has not declared them would simply 404.
  • The four primary verbschatrequest! (:chat), embeddingrequest! (:embeddings), respond (:responses or :agentic, since the two agentic wires name the same surface differently), and generate_image (:images) — validate only endpoints that declare their capabilities. An endpoint with no provider_capabilities method passes through unvalidated.

That asymmetry is deliberate. Defining a ServiceEndpoint subtype is the documented way to reach an OpenAI-compatible backend this package does not ship, and such a backend cannot declare anything — refusing to dispatch it would be a false negative about a server the package knows nothing about. "Undeclared" is therefore no applicable method, never an empty capability set. Declaring capabilities is opt-in strictness: once your endpoint declares, the four primary verbs hold it to that declaration like any built-in.

A rejection throws ArgumentError naming the feature and listing what the provider does support.

Functions

UniLM.provider_capabilitiesFunction
provider_capabilities(service) -> Set{Symbol}

Return the set of capabilities supported by the given service endpoint.

Standard capability symbols include:

  • Core: :chat, :responses, :agentic, :tools, :streaming, :json_output
  • Embeddings & images: :embeddings, :images, :image_edits
  • Completions: :fim, :prefix_completion
  • Platform APIs: :files, :vector_stores, :conversations, :moderation, :audio, :batch, :fine_tuning, :containers, :uploads, :video, :realtime
source
UniLM.has_capabilityFunction
has_capability(service, cap::Symbol) -> Bool

Check whether the service endpoint supports a given capability.

source

Capability Symbols

SymbolDescription
:chatChat Completions API
:responsesResponses API
:agenticAgentic respond verb (OpenAI Responses / Gemini Interactions)
:toolsTool / function calling
:streamingServer-sent-event token streaming (native providers)
:json_outputJSON / structured output mode
:embeddingsEmbeddings API
:imagesImage generation
:image_editsImage editing
:fimFIM (fill-in-the-middle) completion
:prefix_completionPrefix completion (continue a partial assistant message)
:filesFiles API
:vector_storesVector Stores API
:conversationsConversations API
:moderationModerations API
:audioAudio (TTS / transcription / translation)
:batchBatch API
:fine_tuningFine-tuning API
:containersContainers API
:uploadsResumable Uploads API
:videoVideo generation (Sora)
:realtimeRealtime API

Capabilities by Provider

using UniLM

for (name, svc) in [
    ("OpenAI",                 OPENAIServiceEndpoint),
    ("Azure",                  AZUREServiceEndpoint),
    ("Gemini (native)",        GEMINIServiceEndpoint),
    ("Gemini (OpenAI-compat)", GEMINIOpenAIServiceEndpoint),
    ("Anthropic",              ANTHROPICServiceEndpoint),
    ("DeepSeek",               DeepSeekEndpoint("k")),
    ("Generic",                GenericOpenAIEndpoint("http://x", ""))
]
    caps = join(sort(collect(provider_capabilities(svc))), ", ")
    println("$name: $caps")
end
OpenAI: agentic, audio, batch, chat, containers, conversations, embeddings, files, fine_tuning, image_edits, images, json_output, moderation, realtime, responses, tools, uploads, vector_stores, video
Azure: chat, tools
Gemini (native): agentic, chat, streaming, tools
Gemini (OpenAI-compat): chat, embeddings, json_output, tools
Anthropic: chat, json_output, streaming, tools
DeepSeek: chat, fim, json_output, prefix_completion, tools
Generic: chat, embeddings, fim, responses, tools