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

Method create_plan

core/src/planning/llm_planner.rs:96–107  ·  view source on GitHub ↗

Generate an execution plan from a prompt using LLM

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

Source from the content-addressed store, hash-verified

94impl LlmPlanner {
95 /// Generate an execution plan from a prompt using LLM
96 pub async fn create_plan(llm: &Arc<dyn LlmClient>, prompt: &str) -> Result<ExecutionPlan> {
97 let system = crate::prompts::LLM_PLAN_SYSTEM;
98
99 let messages = vec![Message::user(prompt)];
100 let response = llm
101 .complete(&messages, Some(system), &[])
102 .await
103 .context("LLM call failed during plan creation")?;
104
105 let text = response.text();
106 Self::parse_plan_response(&text)
107 }
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> {

Callers

nothing calls this directly

Calls 3

contextMethod · 0.80
completeMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected