-
Notifications
You must be signed in to change notification settings - Fork 3.8k
feat: global whisper transcription provider and telegram voice fix #3029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 3 commits
220fb3f
a307e67
6d036cb
d962c3d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,3 +29,5 @@ venv/ | |
| *.pem | ||
| credentials.json | ||
| .worktrees/ | ||
|
|
||
| .vscode/ | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| Checking zeroclaw v0.1.7 (/Users/antonvice/Documents/programming/zeroclaw) | ||
| error[E0609]: no field `voice_messages_enabled` on type `&TelegramChannel` | ||
| --> src/channels/telegram.rs:1132:28 | ||
| | | ||
| 1132 | let text = if self.voice_messages_enabled { | ||
| | ^^^^^^^^^^^^^^^^^^^^^^ unknown field | ||
| | | ||
| = note: available fields are: `bot_token`, `allowed_users`, `pairing`, `client`, `typing_handle` ... and 10 others | ||
|
|
||
| error[E0560]: struct `TelegramChannel` has no field named `voice_messages_enabled` | ||
| --> src/channels/telegram.rs:347:13 | ||
| | | ||
| 347 | voice_messages_enabled: false, | ||
| | ^^^^^^^^^^^^^^^^^^^^^^ `TelegramChannel` does not have this field | ||
| | | ||
| = note: all struct fields are already assigned | ||
|
|
||
| error[E0609]: no field `voice_messages_enabled` on type `TelegramChannel` | ||
| --> src/channels/telegram.rs:386:14 | ||
| | | ||
| 386 | self.voice_messages_enabled = enabled; | ||
| | ^^^^^^^^^^^^^^^^^^^^^^ unknown field | ||
| | | ||
| = note: available fields are: `bot_token`, `allowed_users`, `pairing`, `client`, `typing_handle` ... and 10 others | ||
|
|
||
| error[E0560]: struct `LarkConfig` has no field named `allow_group_mentions` | ||
| --> src/onboard/wizard.rs:4960:21 | ||
| | | ||
| 4960 | allow_group_mentions: true, | ||
| | ^^^^^^^^^^^^^^^^^^^^ `LarkConfig` does not have this field | ||
| | | ||
| = note: all struct fields are already assigned | ||
|
|
||
| Some errors have detailed explanations: E0560, E0609. | ||
| For more information about an error, try `rustc --explain E0560`. | ||
| error: could not compile `zeroclaw` (lib) due to 4 previous errors | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -162,6 +162,10 @@ Telegram notes: | |
|
|
||
| - `interrupt_on_new_message = true` preserves interrupted user turns in conversation history, then restarts generation on the newest message. | ||
| - Interruption scope is strict: same sender in the same chat. Messages from different chats are processed independently. | ||
| - **Voice Transcription**: Telegram voice notes (`.ogg`) can be transcribed using the global transcription service (configured in the `[transcription]` section). | ||
| - Supported providers: **Groq** (Cloud) and **Local** (Whisper-RS). | ||
| - Local transcription requires `ffmpeg` and automatically downloads a small model on first use. | ||
| - Transcribed text is prepended with `🎙️ [Voice transcription]:`. | ||
|
Comment on lines
+165
to
+168
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Document the actual Telegram config keys here. The note explains the feature, but this section still never names the As per coding guidelines "When runtime surfaces change (CLI, config, provider, channel behavior), update related references in 🤖 Prompt for AI Agents |
||
|
|
||
| ### 4.2 Discord | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -298,6 +298,8 @@ pub struct LarkChannel { | |||||||||||||||||||||||||||||||||
| mention_only: bool, | ||||||||||||||||||||||||||||||||||
| /// When true, use Feishu (CN) endpoints; when false, use Lark (international). | ||||||||||||||||||||||||||||||||||
| use_feishu: bool, | ||||||||||||||||||||||||||||||||||
| /// The platform (Lark vs Feishu) for selecting base URLs and locale headers. | ||||||||||||||||||||||||||||||||||
| platform: LarkPlatform, | ||||||||||||||||||||||||||||||||||
| /// How to receive events: WebSocket long-connection or HTTP webhook. | ||||||||||||||||||||||||||||||||||
| receive_mode: crate::config::schema::LarkReceiveMode, | ||||||||||||||||||||||||||||||||||
| /// Cached tenant access token | ||||||||||||||||||||||||||||||||||
|
|
@@ -321,6 +323,7 @@ impl LarkChannel { | |||||||||||||||||||||||||||||||||
| verification_token, | ||||||||||||||||||||||||||||||||||
| port, | ||||||||||||||||||||||||||||||||||
| allowed_users, | ||||||||||||||||||||||||||||||||||
| mention_only, | ||||||||||||||||||||||||||||||||||
| LarkPlatform::Lark, | ||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
@@ -331,6 +334,7 @@ impl LarkChannel { | |||||||||||||||||||||||||||||||||
| verification_token: String, | ||||||||||||||||||||||||||||||||||
| port: Option<u16>, | ||||||||||||||||||||||||||||||||||
| allowed_users: Vec<String>, | ||||||||||||||||||||||||||||||||||
| mention_only: bool, | ||||||||||||||||||||||||||||||||||
| platform: LarkPlatform, | ||||||||||||||||||||||||||||||||||
| ) -> Self { | ||||||||||||||||||||||||||||||||||
| Self { | ||||||||||||||||||||||||||||||||||
|
|
@@ -341,7 +345,8 @@ impl LarkChannel { | |||||||||||||||||||||||||||||||||
| allowed_users, | ||||||||||||||||||||||||||||||||||
| resolved_bot_open_id: Arc::new(StdRwLock::new(None)), | ||||||||||||||||||||||||||||||||||
| mention_only, | ||||||||||||||||||||||||||||||||||
| use_feishu: true, | ||||||||||||||||||||||||||||||||||
| use_feishu: platform == LarkPlatform::Feishu, | ||||||||||||||||||||||||||||||||||
| platform, | ||||||||||||||||||||||||||||||||||
| receive_mode: crate::config::schema::LarkReceiveMode::default(), | ||||||||||||||||||||||||||||||||||
| tenant_token: Arc::new(RwLock::new(None)), | ||||||||||||||||||||||||||||||||||
| ws_seen_ids: Arc::new(RwLock::new(HashMap::new())), | ||||||||||||||||||||||||||||||||||
|
|
@@ -363,11 +368,31 @@ impl LarkChannel { | |||||||||||||||||||||||||||||||||
| config.port, | ||||||||||||||||||||||||||||||||||
| config.allowed_users.clone(), | ||||||||||||||||||||||||||||||||||
| config.mention_only, | ||||||||||||||||||||||||||||||||||
| platform, | ||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||
| ch.receive_mode = config.receive_mode.clone(); | ||||||||||||||||||||||||||||||||||
| ch | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| pub fn from_lark_config(config: &crate::config::schema::LarkConfig) -> Self { | ||||||||||||||||||||||||||||||||||
| Self::from_config(config) | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+377
to
+379
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Line 378 delegates to 🛠️ Suggested fix pub fn from_lark_config(config: &crate::config::schema::LarkConfig) -> Self {
- Self::from_config(config)
+ let mut ch = Self::new_with_platform(
+ config.app_id.clone(),
+ config.app_secret.clone(),
+ config.verification_token.clone().unwrap_or_default(),
+ config.port,
+ config.allowed_users.clone(),
+ config.mention_only,
+ LarkPlatform::Lark,
+ );
+ ch.receive_mode = config.receive_mode.clone();
+ ch
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| pub fn from_feishu_config(config: &crate::config::schema::FeishuConfig) -> Self { | ||||||||||||||||||||||||||||||||||
| let mut ch = Self::new_with_platform( | ||||||||||||||||||||||||||||||||||
| config.app_id.clone(), | ||||||||||||||||||||||||||||||||||
| config.app_secret.clone(), | ||||||||||||||||||||||||||||||||||
| config.verification_token.clone().unwrap_or_default(), | ||||||||||||||||||||||||||||||||||
| config.port, | ||||||||||||||||||||||||||||||||||
| config.allowed_users.clone(), | ||||||||||||||||||||||||||||||||||
| config.mention_only, | ||||||||||||||||||||||||||||||||||
| LarkPlatform::Feishu, | ||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||
| ch.receive_mode = config.receive_mode.clone(); | ||||||||||||||||||||||||||||||||||
| ch.use_feishu = true; | ||||||||||||||||||||||||||||||||||
| ch | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| fn http_client(&self) -> reqwest::Client { | ||||||||||||||||||||||||||||||||||
| crate::config::build_runtime_proxy_client(self.platform.proxy_service_key()) | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
@@ -1024,16 +1049,12 @@ impl LarkChannel { | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| let (text, post_mentioned_open_ids): (String, Vec<String>) = match msg_type { | ||||||||||||||||||||||||||||||||||
| "text" => { | ||||||||||||||||||||||||||||||||||
| let extracted = serde_json::from_str::<serde_json::Value>(content_str) | ||||||||||||||||||||||||||||||||||
| .ok() | ||||||||||||||||||||||||||||||||||
| .and_then(|v| { | ||||||||||||||||||||||||||||||||||
| v.get("text") | ||||||||||||||||||||||||||||||||||
| .and_then(|t| t.as_str()) | ||||||||||||||||||||||||||||||||||
| .filter(|s| !s.is_empty()) | ||||||||||||||||||||||||||||||||||
| .map(String::from) | ||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||
| match extracted { | ||||||||||||||||||||||||||||||||||
| Some(t) => (t, Vec::new()), | ||||||||||||||||||||||||||||||||||
| let v: serde_json::Value = match serde_json::from_str::<serde_json::Value>(content_str) { | ||||||||||||||||||||||||||||||||||
| Ok(v) => v, | ||||||||||||||||||||||||||||||||||
| Err(_) => return messages, | ||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||
| match v.get("text").and_then(|t| t.as_str()).filter(|s| !s.is_empty()) { | ||||||||||||||||||||||||||||||||||
| Some(t) => (t.to_string(), Vec::new()), | ||||||||||||||||||||||||||||||||||
| None => return messages, | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the committed build log.
This looks like a transient local
cargo checkcapture rather than repository source. It will go stale immediately and also bakes a developer-specific filesystem path into the repo. Please drop the file from the PR and fix the referenced sources instead.🤖 Prompt for AI Agents