Skip to main content

InferCallback

Type Alias InferCallback 

Source
pub type InferCallback = Arc<dyn Fn(String) -> Pin<Box<dyn Future<Output = Result<String, NikaError>> + Send>> + Send + Sync>;
Expand description

Callback type for LLM inference during retry/repair (Layers 3 & 4)

This callback is invoked when the engine needs to re-call the LLM:

  • Layer 3: Retry with validation error feedback
  • Layer 4: Repair call to fix invalid JSON

The callback receives the prompt and returns the LLM response.

Aliased Type§

pub struct InferCallback { /* private fields */ }