pub struct RunId(pub String);Tuple Fields§
§0: StringImplementations§
Source§impl RunId
impl RunId
Sourcepub fn new(value: impl Into<String>) -> Self
pub fn new(value: impl Into<String>) -> Self
Examples found in repository?
examples/yoagent_integration.rs (line 12)
9async fn main() -> Result<(), Box<dyn std::error::Error>> {
10 let state = YoAgentState::load(MemoryEventStore::new()).await?;
11 let sink = YoAgentStateAdapter::new(state.clone(), ActorRef::agent("yoagent"));
12 let run_id = RunId::new("run_demo");
13
14 sink.on_run_started(YoAgentRunStarted {
15 run_id: run_id.clone(),
16 task: "Investigate retry timeout".to_string(),
17 metadata: json!({}),
18 })
19 .await?;
20 sink.on_model_called(YoAgentModelCalled {
21 run_id: run_id.clone(),
22 model: "example-model".to_string(),
23 prompt_summary: "Find likely retry failure cause".to_string(),
24 })
25 .await?;
26 sink.on_model_finished(YoAgentModelFinished {
27 run_id: run_id.clone(),
28 model: "example-model".to_string(),
29 output_summary: "Retry state appears scoped too narrowly".to_string(),
30 })
31 .await?;
32 sink.on_tool_called(YoAgentToolCalled {
33 run_id: run_id.clone(),
34 tool: "cargo test".to_string(),
35 input_summary: "tool_retry_survives_timeout".to_string(),
36 })
37 .await?;
38 sink.on_tool_finished(YoAgentToolFinished {
39 run_id: run_id.clone(),
40 tool: "cargo test".to_string(),
41 output_summary: "test passed".to_string(),
42 success: true,
43 })
44 .await?;
45 sink.on_run_finished(YoAgentRunFinished {
46 run_id,
47 outcome: "patch ready for review".to_string(),
48 metadata: json!({}),
49 })
50 .await?;
51
52 println!(
53 "{}",
54 serde_json::to_string_pretty(&state.store().scan().await?)?
55 );
56 Ok(())
57}pub fn generate() -> Self
pub fn as_str(&self) -> &str
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RunId
impl<'de> Deserialize<'de> for RunId
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for RunId
Source§impl Ord for RunId
impl Ord for RunId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for RunId
impl PartialOrd for RunId
impl StructuralPartialEq for RunId
Auto Trait Implementations§
impl Freeze for RunId
impl RefUnwindSafe for RunId
impl Send for RunId
impl Sync for RunId
impl Unpin for RunId
impl UnsafeUnpin for RunId
impl UnwindSafe for RunId
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