Extract goal from prompt Delegates to [`LlmPlanner`] for structured JSON goal extraction, falling back to heuristic logic if the LLM call fails.
(&self, prompt: &str)
| 158 | /// Delegates to [`LlmPlanner`] for structured JSON goal extraction, |
| 159 | /// falling back to heuristic logic if the LLM call fails. |
| 160 | pub async fn extract_goal(&self, prompt: &str) -> Result<AgentGoal> { |
| 161 | match LlmPlanner::extract_goal(&self.llm_client, prompt).await { |
| 162 | Ok(goal) => Ok(goal), |
| 163 | Err(e) => { |
| 164 | tracing::warn!("LLM goal extraction failed, using fallback: {}", e); |
| 165 | Ok(LlmPlanner::fallback_goal(prompt)) |
| 166 | } |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | /// Check if goal is achieved |
| 171 | /// |
no outgoing calls