// End current step with no parametersawait lai.endStep();// End with evaluationawait lai.endStep({ evalScore: 95, evalDescription: "Successfully completed task"});// End with full updateawait lai.endStep({ state: "Processing complete", action: "Generated report", goal: "Deliver insights", evalScore: 100, evalDescription: "All objectives met"});
// Keep reference to stepconst step1 = await lai.createStep({ state: "Step 1" });const step2 = await lai.createStep({ state: "Step 2" });// End specific step by IDawait lai.endStep({ stepId: step1.stepId, evalScore: 90});// Current active step is still step2await lai.endStep({ evalScore: 95});
// ✅ Good - specific and actionableawait lai.endStep({ evalScore: 75, evalDescription: "Found 3 of 4 required documents, missing user consent form"});// ❌ Less helpfulawait lai.endStep({ evalScore: 75, evalDescription: "Partially complete"});