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

feat: add sample rate to ai proxy

Louis Beaumontb5758c34eaca
diff --git a/screenpipe-actions/ai-proxy/src/index.ts b/screenpipe-actions/ai-proxy/src/index.ts
index a6d10ac85..587c80ade 100644
--- a/screenpipe-actions/ai-proxy/src/index.ts
+++ b/screenpipe-actions/ai-proxy/src/index.ts
@@ -229,10 +229,11 @@ export default {
// Get the raw body instead of form data
const audioBuffer = await request.arrayBuffer();
const languages = request.headers.get('detect_language')?.split(',') || [];
-
+ const sampleRate = request.headers.get('sample_rate') || '16000';
try {
const deepgramResponse = await fetch(
- 'https://api.deepgram.com/v1/listen?model=nova-2&smart_format=true' +
+ 'https://api.deepgram.com/v1/listen?model=nova-2&smart_format=true&sample_rate=' +
+ sampleRate +
(languages.length > 0 ? '&' + languages.map((lang) => `detect_language=${lang}`).join('&') : ''),
{
method: 'POST',