Skip to content
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.DS_Store
*.log
.claude/
.worktrees/
5 changes: 5 additions & 0 deletions src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,11 @@ impl PersonasClient<'_> {
let resp: models::UpdateBackgroundSoundResponse = self.0.patch(url, &req).await?;
Ok(resp.background_sound)
}

pub async fn list_voices(&self) -> Result<models::ListVoicesResponse, ApiError> {
let url = self.0.url("/v1/personas/voices");
self.0.get(url).await
}
}

impl MetricsClient<'_> {
Expand Down
25 changes: 25 additions & 0 deletions src/client/models/persona.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,3 +253,28 @@ pub struct UpdateBackgroundSoundRequest {
pub struct UpdateBackgroundSoundResponse {
pub background_sound: BackgroundSoundResource,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Voice {
pub voice_name: String,
#[serde(default)]
pub supported_languages: Vec<String>,
#[serde(flatten)]
pub extra: serde_json::Map<String, serde_json::Value>,
}

impl Tabular for Voice {
fn headers() -> Vec<&'static str> {
vec!["VOICE NAME", "SUPPORTED LANGUAGES"]
}
Comment thread
greptile-apps[bot] marked this conversation as resolved.

fn row(&self) -> Vec<String> {
let languages = self.supported_languages.join(", ");
vec![self.voice_name.clone(), truncate(&languages, 60)]
}
Comment thread
greptile-apps[bot] marked this conversation as resolved.
}

#[derive(Debug, Deserialize)]
pub struct ListVoicesResponse {
pub voices: Vec<Voice>,
}
12 changes: 12 additions & 0 deletions src/commands/personas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub enum PersonaCommands {
},
#[command(name = "phone-numbers")]
PhoneNumbers,
Voices,
}

impl PersonaCommands {
Expand All @@ -46,6 +47,7 @@ impl PersonaCommands {
Self::Delete(_) => "delete",
Self::BackgroundSounds { command } => command.operation(),
Self::PhoneNumbers => "phone-numbers",
Self::Voices => "voices",
}
}
}
Expand Down Expand Up @@ -279,6 +281,16 @@ pub async fn execute(
vec![next_actions::context("personas")],
);
}
PersonaCommands::Voices => {
let response = client.personas().list_voices().await?;
emit_list_with_actions(
ctx,
"personas",
operation,
&response.voices,
vec![next_actions::context("personas")],
);
}
}
Ok(())
}
Expand Down
Loading