Skip to main content

braid_model/
message.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
4pub enum Role {
5    System,
6    User,
7    Assistant,
8    Tool,
9}
10
11#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
12pub enum ContentPart {
13    Text {
14        text: String,
15    },
16    Image {
17        media_type: String,
18        data: String,
19    },
20    ToolUse {
21        id: String,
22        name: String,
23        input: serde_json::Value,
24    },
25    ToolResult {
26        tool_use_id: String,
27        content: String,
28    },
29}
30
31#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
32pub struct Message {
33    pub role: Role,
34    pub content: Vec<ContentPart>,
35}