Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix: remove deepgram api key

Louis Beaumontc8ab924707bc
diff --git a/screenpipe-app-tauri/lib/hooks/use-settings.tsx b/screenpipe-app-tauri/lib/hooks/use-settings.tsx
index e2361e4dd..37bc2ca20 100644
--- a/screenpipe-app-tauri/lib/hooks/use-settings.tsx
+++ b/screenpipe-app-tauri/lib/hooks/use-settings.tsx
@@ -60,7 +60,7 @@ export interface Settings {
const defaultSettings: Settings = {
openaiApiKey: "",
- deepgramApiKey: "7ed2a159a094337b01fd8178b914b7ae0e77822d", // for now we hardcode our key (dw about using it, we have bunch of credits)
+ deepgramApiKey: "", // for now we hardcode our key (dw about using it, we have bunch of credits)
isLoading: true,
aiModel: "gpt-4o",
installedPipes: [],
@@ -149,8 +149,7 @@ export function useSettings() {
// no need to call load() as it's done automatically
const savedKey = (await store!.get<string>("openaiApiKey")) || "";
const savedDeepgramKey =
- (await store!.get<string>("deepgramApiKey")) ||
- "7ed2a159a094337b01fd8178b914b7ae0e77822d";
+ (await store!.get<string>("deepgramApiKey")) || "";
const savedAiModel = (await store!.get<string>("aiModel")) || "gpt-4o";
const savedInstalledPipes =
(await store!.get<Pipe[]>("installedPipes")) || [];
diff --git a/screenpipe-audio/src/stt.rs b/screenpipe-audio/src/stt.rs
index c2ae39b08..78adc26b8 100644
--- a/screenpipe-audio/src/stt.rs
+++ b/screenpipe-audio/src/stt.rs
@@ -29,10 +29,7 @@ use screenpipe_core::Language;
use serde_json::Value;
use std::io::Cursor;
-// Replace the get_deepgram_api_key function with this:
-fn get_deepgram_api_key() -> String {
- "7ed2a159a094337b01fd8178b914b7ae0e77822d".to_string()
-}
+
async fn transcribe_with_deepgram(
api_key: &str,
@@ -369,45 +366,39 @@ pub async fn stt(
return Ok(("".to_string(), "".to_string()));
}
- let transcription: Result<String> =
- if audio_transcription_engine == AudioTranscriptionEngine::Deepgram.into() {
- // Deepgram implementation
- let api_key = deepgram_api_key
- .clone()
- .unwrap_or_else(get_deepgram_api_key);
- info!(
- "device: {}, using deepgram api key: {}...",
- audio_input.device,
- &api_key[..8]
- );
- match transcribe_with_deepgram(
- &api_key,
- &speech_frames,
- &audio_input.device.name,
- audio_input.sample_rate,
- languages.clone(),
- )
- .await
- {
- Ok(transcription) => Ok(transcription),
- Err(e) => {
- error!(
- "device: {}, deepgram transcription failed, falling back to Whisper: {:?}",
- audio_input.device, e
- );
- // Fallback to Whisper
- process_with_whisper(
- &mut *whisper_model,
- &speech_frames,
- &mel_filters,
- languages.clone(),
- )
- }
+ let transcription: Result<String> = if audio_transcription_engine
+ == AudioTranscriptionEngine::Deepgram.into()
+ {
+ // Deepgram implementation
+ let api_key = deepgram_api_key.unwrap();
+ info!(
+ "device: {}, using deepgram api key: {}...",
+ audio_input.device,
+ &api_key[..8]
+ );
+ match transcribe_with_deepgram(
+ &api_key,
+ &speech_frames,
+ &audio_input.device.name,
+ audio_input.sample_rate,
+ languages.clone(),
+ )
+ .await
+ {
+ Ok(transcription) => Ok(transcription),
+ Err(e) => {
+ error!(
+ "device: {}, deepgram transcription failed, falling back to Whisper: {:?}",
+ audio_input.device, e
+ );
+ // Fallback to Whisper
+ process_with_whisper(&mut *whisper_model, &speech_frames, &mel_filters, languages)
}
- } else {
- // Existing Whisper implementation
- process_with_whisper(&mut *whisper_model, &speech_frames, &mel_filters, languages)
- };
+ }
+ } else {
+ // Existing Whisper implementation
+ process_with_whisper(&mut *whisper_model, &speech_frames, &mel_filters, languages)
+ };
let new_file_name = Utc::now().format("%Y-%m-%d_%H-%M-%S").to_string();
let sanitized_device_name = audio_input.device.to_string().replace(['/', '\\'], "_");