MCPcopy Create free account
hub / github.com/AI45Lab/Code / extract_goal

Method extract_goal

core/src/agent/planning_runtime.rs:160–168  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 ///

Calls

no outgoing calls