mini\inference() Function

Documentation

Get the inference service instance

Returns the configured InferenceServiceInterface implementation for LLM-based structured evaluation.

Usage: // Boolean question $result = inference()->evaluate("Is this spam?\n\n$text", validator()->enum([true, false]));

// Classification $category = inference()->evaluate("Classify:\n\n$text", validator()->enum(['bug', 'feature', 'question']));

// Structured extraction $data = inference()->evaluate($prompt, validator()->type('object')->properties([ 'summary' => validator()->type('string')->required(), 'priority' => validator()->enum(['low', 'medium', 'high']), ]));

Signature

function inference(): mini\Inference\InferenceServiceInterface

Returns

mini\Inference\InferenceServiceInterface

Source

src/Inference/functions.php:42-45