Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions crates/goose-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ pub struct TokenState {
pub accumulated_cost: Option<f64>,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, ToSchema)]
pub enum ToolCallResult<T> {
Success { value: T },
Error { error: String },
}

impl MessageMetadata {
pub fn agent_only() -> Self {
Self {
Expand Down
8 changes: 1 addition & 7 deletions crates/goose/src/conversation/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use chrono::Utc;
pub use goose_types::{
InferenceMetadata, MessageMetadata, MessageProviderMetadata as ProviderMetadata,
RedactedThinkingContent, SystemNotificationContent, SystemNotificationType, ThinkingContent,
TokenState,
TokenState, ToolCallResult,
};
use rmcp::model::{
AnnotateAble, CallToolRequestParams, CallToolResult, Content, ImageContent, JsonObject,
Expand All @@ -18,12 +18,6 @@ use std::fmt;
use utoipa::ToSchema;
use uuid::Uuid;

#[derive(ToSchema)]
pub enum ToolCallResult<T> {
Success { value: T },
Error { error: String },
}

/// Custom deserializer for MessageContent that sanitizes Unicode Tags in text content
fn deserialize_sanitized_content<'de, D>(deserializer: D) -> Result<Vec<MessageContent>, D::Error>
where
Expand Down