interface StepConfig { state?: string; // Current state/context action?: string; // What the agent is doing goal?: string; // What the agent aims to achieve evalScore?: number; // Performance score (0-100) evalDescription?: string; // Explanation of score}
// Update current stepawait lai.updateStep( step.stepId, false, // isFinished 85, // evalScore 'Partially extracted entities');// End current stepawait lai.endStep(95, 'Successfully identified all intents');// Get active stepconst activeStep = lai.getActiveStep();
If you make an LLM call without an active step, one is created automatically:
Copy
Ask AI
// No step created yetconst response = await openai.chat.completions.create({ model: 'gpt-4', messages: [{ role: 'user', content: 'Hello!' }]});// Lucidic auto-creates a step for this call
LLM calls from instrumented providers create events automatically:
Copy
Ask AI
// Just make the call - event is created automaticallyawait openai.chat.completions.create({ model: 'gpt-4', messages: [{ role: 'user', content: 'Hello!' }]});