Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ModelCapabilities ¶
type ModelCapabilities struct {
InputModalities []string // "text","image","audio","video"
}
func FetchCapabilities ¶
func FetchCapabilities(ctx context.Context, baseURL, apiKey, model string) ModelCapabilities
FetchCapabilities asks LocalAI's /models/capabilities endpoint for the given model's input modalities. Any failure (network, decode, unknown model) is treated as text-only so we never hand media to a model that can't take it.
func (ModelCapabilities) Accepts ¶
func (m ModelCapabilities) Accepts(mod string) bool
type Result ¶
func Apply ¶
func Apply(ctx context.Context, files []string, caps ModelCapabilities, overrides map[string]Override, extract Extractor, transcribe Transcriber) (Result, error)
Apply resolves each file to its treatment and executes it, producing the native parts + text preamble SendMessage needs, plus any blocked files for the caller to surface. overrides maps a file path to an audio override (may be nil).
Apply is all-or-nothing on hard failures: the first extractor, transcriber, or DataURI error aborts the whole batch and is returned as-is (the caller is expected to resolve or remove the offending file and retry). Only capability Block outcomes are non-fatal — they are collected into Result.Blocked rather than erroring, so a batch containing a lone unsupported file still returns a nil error with that file recorded in Blocked.