pub struct Workflow { /* private fields */ }Expand description
One reusable workflow handle:
- simple path:
run(prompt) - expert path: profile/config mutation via
WorkflowConfig
Implementations§
Source§impl Workflow
impl Workflow
Sourcepub async fn connect(config: WorkflowConfig) -> Result<Self, ClientError>
pub async fn connect(config: WorkflowConfig) -> Result<Self, ClientError>
Connect once with one explicit workflow config.
Sourcepub async fn connect_default(
cwd: impl Into<String>,
) -> Result<Self, ClientError>
pub async fn connect_default( cwd: impl Into<String>, ) -> Result<Self, ClientError>
Connect with defaults for one cwd.
Sourcepub async fn run(
&self,
prompt: impl Into<String>,
) -> Result<PromptRunResult, PromptRunError>
pub async fn run( &self, prompt: impl Into<String>, ) -> Result<PromptRunResult, PromptRunError>
Run one prompt using workflow defaults.
Sourcepub async fn run_with_profile(
&self,
prompt: impl Into<String>,
profile: RunProfile,
) -> Result<PromptRunResult, PromptRunError>
pub async fn run_with_profile( &self, prompt: impl Into<String>, profile: RunProfile, ) -> Result<PromptRunResult, PromptRunError>
Run one prompt with explicit profile override.
Sourcepub async fn setup_session(&self) -> Result<Session, PromptRunError>
pub async fn setup_session(&self) -> Result<Session, PromptRunError>
Start one session using workflow defaults.
Sourcepub async fn setup_session_with_profile(
&self,
profile: RunProfile,
) -> Result<Session, PromptRunError>
pub async fn setup_session_with_profile( &self, profile: RunProfile, ) -> Result<Session, PromptRunError>
Start one session with explicit profile override.
pub fn config(&self) -> &WorkflowConfig
pub fn client(&self) -> &Client
Sourcepub async fn shutdown(self) -> Result<(), RuntimeError>
pub async fn shutdown(self) -> Result<(), RuntimeError>
Explicit shutdown to keep lifecycle obvious.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Workflow
impl !RefUnwindSafe for Workflow
impl Send for Workflow
impl Sync for Workflow
impl Unpin for Workflow
impl UnsafeUnpin for Workflow
impl !UnwindSafe for Workflow
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