pub enum CallId {
Provider(ProviderCallId),
Local(LocalCallId),
}Expand description
A tool call’s one identity: the id the provider issued, or one rig issued because the provider sent none.
A result copies the id of the call it answers (ToolCall::result), so
the two always match.
use rig_core::message::{CallId, ProviderCallId};
let id = CallId::from(ProviderCallId::new("call_1").ok_or("empty id")?);
assert_eq!(id.to_string(), "call_1");
assert_eq!(id.provider().map(ProviderCallId::as_str), Some("call_1"));Variants§
Provider(ProviderCallId)
The provider’s id.
Local(LocalCallId)
An identifier rig issued for a call the provider sent without one.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CallId
impl<'de> Deserialize<'de> for CallId
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CallId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CallId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for CallId
Source§impl From<LocalCallId> for CallId
impl From<LocalCallId> for CallId
Source§fn from(local: LocalCallId) -> CallId
fn from(local: LocalCallId) -> CallId
Converts to this type from the input type.
Source§impl From<ProviderCallId> for CallId
impl From<ProviderCallId> for CallId
Source§fn from(provider: ProviderCallId) -> CallId
fn from(provider: ProviderCallId) -> CallId
Converts to this type from the input type.
Source§impl Ord for CallId
impl Ord for CallId
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for CallId
impl PartialOrd for CallId
Source§impl Serialize for CallId
impl Serialize for CallId
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for CallId
Auto Trait Implementations§
impl Forget for CallId
impl Freeze for CallId
impl Move for CallId
impl RefUnwindSafe for CallId
impl Send for CallId
impl Sync for CallId
impl Unpin for CallId
impl UnsafeUnpin for CallId
impl UnwindSafe for CallId
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> 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> IntoToolOutput for Twhere
T: Serialize + 'static,
impl<T> IntoToolOutput for Twhere
T: Serialize + 'static,
Source§fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
Convert this value without routing structured data through a string.