39 lines
954 B
Python
39 lines
954 B
Python
"""V1R2C1 planner client abstraction."""
|
|
|
|
from dataclasses import dataclass, field
|
|
from typing import Any, Dict, List
|
|
|
|
|
|
@dataclass
|
|
class Plan:
|
|
objective: str
|
|
steps: List[str] = field(default_factory=list)
|
|
metadata: Dict[str, Any] = field(default_factory=dict)
|
|
|
|
|
|
class PlannerClient:
|
|
"""Planner interface for GPT planning workers.
|
|
|
|
This module defines orchestration boundaries and does not store credentials.
|
|
"""
|
|
|
|
def __init__(self):
|
|
self.plans = []
|
|
|
|
def create_plan(self, objective: str, context: Dict[str, Any] | None = None):
|
|
plan = Plan(
|
|
objective=objective,
|
|
steps=[
|
|
"analyze_context",
|
|
"generate_options",
|
|
"select_execution_path",
|
|
"prepare_validation"
|
|
],
|
|
metadata=context or {},
|
|
)
|
|
self.plans.append(plan)
|
|
return plan
|
|
|
|
def history(self):
|
|
return self.plans
|