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

Method extract_goal

core/src/planning/llm_planner.rs:110–121  ·  view source on GitHub ↗

Extract a goal with success criteria from a prompt using LLM

(llm: &Arc<dyn LlmClient>, prompt: &str)

Source from the content-addressed store, hash-verified

108
109 /// Extract a goal with success criteria from a prompt using LLM
110 pub async fn extract_goal(llm: &Arc<dyn LlmClient>, prompt: &str) -> Result<AgentGoal> {
111 let system = crate::prompts::LLM_GOAL_EXTRACT_SYSTEM;
112
113 let messages = vec![Message::user(prompt)];
114 let response = llm
115 .complete(&messages, Some(system), &[])
116 .await
117 .context("LLM call failed during goal extraction")?;
118
119 let text = response.text();
120 Self::parse_goal_response(&text)
121 }
122
123 /// Evaluate whether a goal has been achieved given current state
124 pub async fn check_achievement(

Callers

nothing calls this directly

Calls 3

contextMethod · 0.80
completeMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected