1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
//! Conversation CLI arguments
use clap::{Args, Subcommand};
/// Conversation arguments
#[derive(Args)]
pub struct ConversationArgs {
#[command(subcommand)]
pub command: ConversationCommands,
}
#[derive(Args)]
pub struct ConverseArgs {
/// Agent ID to converse with
#[arg(long)]
pub agent_id: String,
/// Initial user message
#[arg(short, long)]
pub message: Option<String>,
/// Audio input file (for testing)
#[arg(long, value_name = "FILE")]
pub audio: Option<String>,
/// Maximum conversation turns
#[arg(long)]
pub max_turns: Option<u32>,
/// Play agent audio responses in real-time
#[arg(long)]
pub play: bool,
/// Output audio device name
#[arg(long, value_name = "DEVICE")]
pub output_device: Option<String>,
}
#[derive(Subcommand)]
pub enum ConversationCommands {
/// Start a WebSocket conversation with an agent
#[command(name = "chat")]
Converse(ConverseArgs),
/// List conversations
List {
/// Filter by agent ID
#[arg(long)]
agent_id: Option<String>,
/// Filter by branch ID
#[arg(long)]
branch_id: Option<String>,
/// Page size
#[arg(short, long)]
limit: Option<u32>,
},
/// Get conversation details
Get {
/// Conversation ID
conversation_id: String,
},
/// Get signed URL for conversation
SignedUrl {
/// Agent ID
agent_id: String,
/// Branch ID filter
#[arg(short, long)]
branch_id: Option<String>,
},
/// Get conversation token
Token {
/// Agent ID
agent_id: String,
/// Branch ID filter
#[arg(short, long)]
branch_id: Option<String>,
},
/// Delete a conversation
Delete {
/// Conversation ID
conversation_id: String,
},
/// Download conversation audio
Audio {
/// Conversation ID
conversation_id: String,
/// Output file path
#[arg(short, long, value_name = "OUTPUT")]
output: Option<String>,
},
/// Send feedback on a conversation
Feedback {
/// Conversation ID
conversation_id: String,
/// Thumbs up or down
#[arg(short, long)]
thumbs_up: bool,
/// Optional feedback text
#[arg(short, long)]
feedback: Option<String>,
},
/// Make an outbound call via Twilio
Outbound {
/// Agent ID
#[arg(long)]
agent_id: String,
/// Caller ID (your Twilio phone number)
#[arg(long)]
caller_id: String,
/// Phone number to call
#[arg(long)]
to: String,
/// Initial greeting/message
#[arg(short, long)]
message: Option<String>,
},
}