pub struct ChatbotConversationMessageToolCall {
pub id: Uuid,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub deleted_at: Option<DateTime<Utc>>,
pub chatbot_conversation_message_id: Uuid,
pub tool_name: String,
pub tool_arguments: Value,
pub tool_call_id: String,
pub tool_kind: ToolKind,
pub response_id: String,
}Fields§
§id: Uuid§created_at: DateTime<Utc>§updated_at: DateTime<Utc>§deleted_at: Option<DateTime<Utc>>§chatbot_conversation_message_id: Uuid§tool_name: String§tool_arguments: ValueIs type = string in the OpenApi schema, because there is no known shape for this JSON value/object so we treat it as ‘string’ instead of ‘unknown’ in the API autogenerated types. Since it’s valid JSON, we save it as JSON in our DB.
tool_call_id: String§tool_kind: ToolKind§response_id: StringImplementations§
Source§impl ChatbotConversationMessageToolCall
impl ChatbotConversationMessageToolCall
Sourcepub fn new(
tool_call_id: String,
tool_name: String,
arguments: String,
tool_kind: ToolKind,
response_id: String,
) -> Self
pub fn new( tool_call_id: String, tool_name: String, arguments: String, tool_kind: ToolKind, response_id: String, ) -> Self
A call ready to be inserted, recording arguments as the JSON text the model wrote for it.
Storing the text rather than the object it parses into is what lets Self::arguments_json
hand it back to the model unchanged; go through here rather than filling
Self::tool_arguments yourself.
Sourcepub fn arguments_json(&self) -> String
pub fn arguments_json(&self) -> String
The argument JSON of the call. A call is recorded with the JSON text the model produced
rather than with its parsed shape, so Self::tool_arguments is normally a JSON string.
Use this rather than serializing the stored value, which would escape that text a second time and both feed the model garbage and break the prefix its prompt cache matches on.
Trait Implementations§
Source§impl Clone for ChatbotConversationMessageToolCall
impl Clone for ChatbotConversationMessageToolCall
Source§fn clone(&self) -> ChatbotConversationMessageToolCall
fn clone(&self) -> ChatbotConversationMessageToolCall
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ComposeSchema for ChatbotConversationMessageToolCall
impl ComposeSchema for ChatbotConversationMessageToolCall
Source§impl<'de> Deserialize<'de> for ChatbotConversationMessageToolCall
impl<'de> Deserialize<'de> for ChatbotConversationMessageToolCall
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>,
Source§impl PartialEq for ChatbotConversationMessageToolCall
impl PartialEq for ChatbotConversationMessageToolCall
Source§fn eq(&self, other: &ChatbotConversationMessageToolCall) -> bool
fn eq(&self, other: &ChatbotConversationMessageToolCall) -> bool
self and other values to be equal, and is used by ==.Source§impl ToSchema for ChatbotConversationMessageToolCall
impl ToSchema for ChatbotConversationMessageToolCall
impl StructuralPartialEq for ChatbotConversationMessageToolCall
Auto Trait Implementations§
impl Freeze for ChatbotConversationMessageToolCall
impl RefUnwindSafe for ChatbotConversationMessageToolCall
impl Send for ChatbotConversationMessageToolCall
impl Sync for ChatbotConversationMessageToolCall
impl Unpin for ChatbotConversationMessageToolCall
impl UnsafeUnpin for ChatbotConversationMessageToolCall
impl UnwindSafe for ChatbotConversationMessageToolCall
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].