pub struct PipeRequest {
pub name: String,
pub messages: Vec<Message>,
pub stream: bool,
pub variables: Option<HashMap<String, String>>,
pub thread_id: Option<String>,
}Expand description
Request to run a Langbase pipe.
Fields§
§name: StringPipe name (required by Langbase API).
messages: Vec<Message>Conversation messages to send.
stream: boolDisable streaming (default: false for non-streaming response).
variables: Option<HashMap<String, String>>Optional template variables.
thread_id: Option<String>Optional thread ID for conversation continuity.
Implementations§
Source§impl PipeRequest
impl PipeRequest
Sourcepub fn new(name: impl Into<String>, messages: Vec<Message>) -> Self
pub fn new(name: impl Into<String>, messages: Vec<Message>) -> Self
Create a new pipe request with name and messages
Sourcepub fn with_variables(self, variables: HashMap<String, String>) -> Self
pub fn with_variables(self, variables: HashMap<String, String>) -> Self
Add variables to the request
Sourcepub fn with_variable(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_variable( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add a single variable
Sourcepub fn with_thread_id(self, thread_id: impl Into<String>) -> Self
pub fn with_thread_id(self, thread_id: impl Into<String>) -> Self
Set the thread ID for conversation continuity
Trait Implementations§
Source§impl Clone for PipeRequest
impl Clone for PipeRequest
Source§fn clone(&self) -> PipeRequest
fn clone(&self) -> PipeRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PipeRequest
impl Debug for PipeRequest
Auto Trait Implementations§
impl Freeze for PipeRequest
impl RefUnwindSafe for PipeRequest
impl Send for PipeRequest
impl Sync for PipeRequest
impl Unpin for PipeRequest
impl UnwindSafe for PipeRequest
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more