Check if goal is achieved Delegates to [`LlmPlanner`] for structured JSON achievement check, falling back to heuristic logic if the LLM call fails.
(
&self,
goal: &AgentGoal,
current_state: &str,
)
| 172 | /// Delegates to [`LlmPlanner`] for structured JSON achievement check, |
| 173 | /// falling back to heuristic logic if the LLM call fails. |
| 174 | pub async fn check_goal_achievement( |
| 175 | &self, |
| 176 | goal: &AgentGoal, |
| 177 | current_state: &str, |
| 178 | ) -> Result<bool> { |
| 179 | match LlmPlanner::check_achievement(&self.llm_client, goal, current_state).await { |
| 180 | Ok(result) => Ok(result.achieved), |
| 181 | Err(e) => { |
| 182 | tracing::warn!("LLM achievement check failed, using fallback: {}", e); |
| 183 | let result = LlmPlanner::fallback_check_achievement(goal, current_state); |
| 184 | Ok(result.achieved) |
| 185 | } |
| 186 | } |
| 187 | } |
| 188 | } |
no outgoing calls