pub struct RunScope { /* private fields */ }Expand description
Ergonomic wrapper around Tracer that standardizes:
- inputs/outputs serialization
- post/end/patch flow
- error handling (best-effort patching)
This is intended to keep application code small and declarative.
Implementations§
Source§impl RunScope
impl RunScope
pub fn root<I: Serialize>( name: &str, run_type: RunType, inputs: I, ) -> Result<Self>
pub fn root_value(name: &str, run_type: RunType, inputs: Value) -> Self
pub fn with_thread_id(self, thread_id: impl Into<String>) -> Self
pub fn with_context(self, ctx: &TraceContext) -> Self
pub fn tracer(&self) -> &Tracer
pub fn tracer_mut(&mut self) -> &mut Tracer
pub fn child<I: Serialize>( &self, name: &str, run_type: RunType, inputs: I, ) -> Result<Self>
pub fn child_value(&self, name: &str, run_type: RunType, inputs: Value) -> Self
Sourcepub async fn post_start(&mut self) -> Result<()>
pub async fn post_start(&mut self) -> Result<()>
Posts the run start to LangSmith. Safe to call multiple times.
Auto Trait Implementations§
impl !RefUnwindSafe for RunScope
impl !UnwindSafe for RunScope
impl Freeze for RunScope
impl Send for RunScope
impl Sync for RunScope
impl Unpin for RunScope
impl UnsafeUnpin for RunScope
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