pub struct Task {Show 18 fields
pub id: String,
pub from_agent: String,
pub to_agent: String,
pub state: TaskState,
pub description: String,
pub messages: Vec<TaskMessage>,
pub artifacts: Vec<TaskPart>,
pub history: Vec<TaskTransition>,
pub metadata: HashMap<String, String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub tenant_id: Option<String>,
pub project_id: Option<String>,
pub action: Option<String>,
pub idempotency_key: Option<String>,
pub authority_key_id: Option<String>,
pub descriptor_digest: Option<String>,
pub artifact_refs: Vec<AgentArtifactRefV1>,
}Fields§
§id: String§from_agent: String§to_agent: String§state: TaskState§description: String§messages: Vec<TaskMessage>§artifacts: Vec<TaskPart>§history: Vec<TaskTransition>§metadata: HashMap<String, String>§created_at: DateTime<Utc>§updated_at: DateTime<Utc>§tenant_id: Option<String>§project_id: Option<String>§action: Option<String>§idempotency_key: Option<String>§descriptor_digest: Option<String>§artifact_refs: Vec<AgentArtifactRefV1>Implementations§
Source§impl Task
impl Task
pub fn new(from_agent: &str, to_agent: &str, description: &str) -> Self
Sourcepub fn served(&self) -> Self
pub fn served(&self) -> Self
A copy of the task for delivery to a tool result or a peer.
Description, message parts, artifacts, metadata values and caller-typed transition reasons are each served on their own; a part that is withheld is replaced in place by the typed gateway notice, so the shape of the task (counts, order, states, timestamps, ids) is what is stored. The stored task is not changed.
Sourcepub fn served_description(&self) -> String
pub fn served_description(&self) -> String
The description alone as Self::served delivers it, for a listing
that prints nothing else of the task’s text.
pub fn status_v1(&self) -> TaskStatusV1
pub fn transition( &mut self, new_state: TaskState, reason: Option<&str>, ) -> Result<(), String>
pub fn add_message(&mut self, role: &str, parts: Vec<TaskPart>)
pub fn add_artifact(&mut self, artifact: TaskPart)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Task
impl<'de> Deserialize<'de> for Task
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
Auto Trait Implementations§
impl Forget for Task
impl Freeze for Task
impl Move for Task
impl RefUnwindSafe for Task
impl Send for Task
impl Sync for Task
impl Unpin for Task
impl UnsafeUnpin for Task
impl UnwindSafe for Task
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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