Compare commits
1
Commits
main
...
205687fc89
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
205687fc89 |
@@ -24,6 +24,8 @@ from scipy.io import wavfile
|
|||||||
|
|
||||||
OPENAI_TRANSCRIPTIONS_URL = "https://api.openai.com/v1/audio/transcriptions"
|
OPENAI_TRANSCRIPTIONS_URL = "https://api.openai.com/v1/audio/transcriptions"
|
||||||
OPENROUTER_TRANSCRIPTIONS_URL = "https://openrouter.ai/api/v1/audio/transcriptions"
|
OPENROUTER_TRANSCRIPTIONS_URL = "https://openrouter.ai/api/v1/audio/transcriptions"
|
||||||
|
OPENROUTER_APP_URL = "https://git.felixm.de/felixm/blurt"
|
||||||
|
OPENROUTER_APP_TITLE = "Blurt"
|
||||||
DEFAULT_TRANSCRIPTION_MODEL = "whisper-1"
|
DEFAULT_TRANSCRIPTION_MODEL = "whisper-1"
|
||||||
DEFAULT_TRANSCRIPTION_LANGUAGE = "en"
|
DEFAULT_TRANSCRIPTION_LANGUAGE = "en"
|
||||||
# (model_id, menu_label, provider). The provider selects both the API endpoint
|
# (model_id, menu_label, provider). The provider selects both the API endpoint
|
||||||
@@ -547,7 +549,11 @@ class BlurtApp:
|
|||||||
audio_b64 = base64.b64encode(wav_bytes).decode("ascii")
|
audio_b64 = base64.b64encode(wav_bytes).decode("ascii")
|
||||||
response = self.session.post(
|
response = self.session.post(
|
||||||
OPENROUTER_TRANSCRIPTIONS_URL,
|
OPENROUTER_TRANSCRIPTIONS_URL,
|
||||||
headers={"Authorization": f"Bearer {self.api_keys['openrouter']}"},
|
headers={
|
||||||
|
"Authorization": f"Bearer {self.api_keys['openrouter']}",
|
||||||
|
"HTTP-Referer": OPENROUTER_APP_URL,
|
||||||
|
"X-OpenRouter-Title": OPENROUTER_APP_TITLE,
|
||||||
|
},
|
||||||
json={
|
json={
|
||||||
"model": self.transcription_model,
|
"model": self.transcription_model,
|
||||||
"input_audio": {"data": audio_b64, "format": "wav"},
|
"input_audio": {"data": audio_b64, "format": "wav"},
|
||||||
|
|||||||
Reference in New Issue
Block a user