pub struct FlowBuilder { /* private fields */ }Expand description
Programmatically build a Flow definition.
§Example
use stepflow_client::{FlowBuilder, ValueExpr};
let mut builder = FlowBuilder::new();
builder.add_step(
"summarize",
"/builtin/openai",
ValueExpr::object(vec![
("model".to_string(), ValueExpr::literal(serde_json::json!("gpt-4o"))),
]),
);
let flow = builder
.output(ValueExpr::step_output("summarize"))
.build()
.unwrap();Implementations§
Source§impl FlowBuilder
impl FlowBuilder
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Set the flow description.
Sourcepub fn add_step(
&mut self,
id: impl Into<String>,
component: impl Into<String>,
input: impl Into<ValueExpr>,
)
pub fn add_step( &mut self, id: impl Into<String>, component: impl Into<String>, input: impl Into<ValueExpr>, )
Trait Implementations§
Source§impl Debug for FlowBuilder
impl Debug for FlowBuilder
Source§impl Default for FlowBuilder
impl Default for FlowBuilder
Source§fn default() -> FlowBuilder
fn default() -> FlowBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FlowBuilder
impl RefUnwindSafe for FlowBuilder
impl Send for FlowBuilder
impl Sync for FlowBuilder
impl Unpin for FlowBuilder
impl UnsafeUnpin for FlowBuilder
impl UnwindSafe for FlowBuilder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request