mini\Inference\InferenceServiceInterface::evaluate()
Method
public
abstract
Signature
public abstract function evaluate(string $prompt, mini\Validator\Validator|JsonSerializable|array $schema): mixed
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$prompt |
string |
required | Documentation missing |
$schema |
mini\Validator\Validator|JsonSerializable|array |
required | Documentation missing |
Returns
mixed
Documentation
Evaluate a prompt and return a structured response matching the schema
The schema parameter accepts:
- Validator instance (recommended) - serializes to JSON Schema via JsonSerializable
- Any JsonSerializable that produces valid JSON Schema
- Raw array representing JSON Schema
The implementation should:
- Send the prompt to the LLM with the schema as output format constraint
- Parse the JSON response
- Optionally validate the response matches the schema
- Return the parsed result