pub struct PlanningSession {
pub metadata: SessionMetadata,
pub session_dir: PathBuf,
pub conversation_path: PathBuf,
}Expand description
A planning session for human-in-the-loop workflows.
Fields§
§metadata: SessionMetadataSession metadata
session_dir: PathBufPath to the session directory
conversation_path: PathBufPath to the conversation file
Implementations§
Source§impl PlanningSession
impl PlanningSession
Sourcepub fn new(
prompt: &str,
context: &LoopContext,
config: Option<String>,
) -> Result<Self, PlanningSessionError>
pub fn new( prompt: &str, context: &LoopContext, config: Option<String>, ) -> Result<Self, PlanningSessionError>
Create a new planning session.
§Arguments
prompt- The user’s original prompt/ideacontext- The loop context for path resolutionconfig- Optional config file to use
Sourcepub fn load(
id: &str,
context: &LoopContext,
) -> Result<Self, PlanningSessionError>
pub fn load( id: &str, context: &LoopContext, ) -> Result<Self, PlanningSessionError>
Load an existing planning session.
§Arguments
id- The session IDcontext- The loop context for path resolution
Sourcepub fn set_status(
&mut self,
status: SessionStatus,
) -> Result<(), PlanningSessionError>
pub fn set_status( &mut self, status: SessionStatus, ) -> Result<(), PlanningSessionError>
Update the session status.
Sourcepub fn increment_iterations(&mut self) -> Result<(), PlanningSessionError>
pub fn increment_iterations(&mut self) -> Result<(), PlanningSessionError>
Increment the iteration counter.
Sourcepub fn save_metadata(&self) -> Result<(), PlanningSessionError>
pub fn save_metadata(&self) -> Result<(), PlanningSessionError>
Save the session metadata to disk.
Sourcepub fn append_prompt(
&self,
id: &str,
text: &str,
) -> Result<(), PlanningSessionError>
pub fn append_prompt( &self, id: &str, text: &str, ) -> Result<(), PlanningSessionError>
Append a prompt entry to the conversation.
§Arguments
id- Unique prompt identifier (e.g., “q1”, “q2”)text- The prompt/question text
Sourcepub fn append_response(
&mut self,
id: &str,
text: &str,
) -> Result<(), PlanningSessionError>
pub fn append_response( &mut self, id: &str, text: &str, ) -> Result<(), PlanningSessionError>
Append a response entry to the conversation.
§Arguments
id- The prompt ID this responds totext- The user’s response text
Sourcepub fn find_response(
&self,
prompt_id: &str,
) -> Result<Option<String>, PlanningSessionError>
pub fn find_response( &self, prompt_id: &str, ) -> Result<Option<String>, PlanningSessionError>
Find a response to a specific prompt in the conversation.
§Arguments
prompt_id- The prompt ID to search for
Returns the response text if found, None otherwise.
Sourcepub fn load_conversation(
&self,
) -> Result<Vec<ConversationEntry>, PlanningSessionError>
pub fn load_conversation( &self, ) -> Result<Vec<ConversationEntry>, PlanningSessionError>
Load all conversation entries.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PlanningSession
impl RefUnwindSafe for PlanningSession
impl Send for PlanningSession
impl Sync for PlanningSession
impl Unpin for PlanningSession
impl UnsafeUnpin for PlanningSession
impl UnwindSafe for PlanningSession
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more