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
17 changes: 17 additions & 0 deletions crates/goose-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,23 @@ impl Default for MessageMetadata {

pub type MessageProviderMetadata = serde_json::Map<String, serde_json::Value>;

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, ToSchema)]
#[serde(rename_all = "camelCase")]
pub enum SystemNotificationType {
ThinkingMessage,
InlineMessage,
CreditsExhausted,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ToSchema)]
#[serde(rename_all = "camelCase")]
pub struct SystemNotificationContent {
pub notification_type: SystemNotificationType,
pub msg: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub data: Option<serde_json::Value>,
}

impl MessageMetadata {
pub fn agent_only() -> Self {
Self {
Expand Down
19 changes: 1 addition & 18 deletions crates/goose/src/conversation/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::utils::sanitize_unicode_tags;
use chrono::Utc;
pub use goose_types::{
InferenceMetadata, MessageMetadata, MessageProviderMetadata as ProviderMetadata,
RedactedThinkingContent, ThinkingContent,
RedactedThinkingContent, SystemNotificationContent, SystemNotificationType, ThinkingContent,
};
use rmcp::model::{
AnnotateAble, CallToolRequestParams, CallToolResult, Content, ImageContent, JsonObject,
Expand Down Expand Up @@ -229,23 +229,6 @@ pub struct FrontendToolRequest {
pub tool_call: ToolResult<CallToolRequestParams>,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ToSchema)]
#[serde(rename_all = "camelCase")]
pub enum SystemNotificationType {
ThinkingMessage,
InlineMessage,
CreditsExhausted,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ToSchema)]
#[serde(rename_all = "camelCase")]
pub struct SystemNotificationContent {
pub notification_type: SystemNotificationType,
pub msg: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub data: Option<serde_json::Value>,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ToSchema)]
/// Content passed inside a message, which can be both simple content and tool content
#[serde(tag = "type", rename_all = "camelCase")]
Expand Down