mirror of
https://github.com/yusufipk/dikte.git
synced 2026-09-11 10:56:10 +00:00
Transcribe on OpenRouter too, not just OpenAI
OpenRouter mirrors OpenAI's /audio/transcriptions field for field, so one multipart request serves both providers and only the key, the base URL and the model id change. That puts a dozen speech models behind the key that was already there for the cleanup, and makes a single OpenRouter key enough for the whole chain. Its transcription endpoint takes no hint field, so the words from Cleanup rules are not sent there; they still reach the cleanup model as a glossary. Timestamps switch to openai/whisper-1, the namespaced id of the only model that returns segment times. The API tab is now grouped by role rather than by service, because a key no longer belongs to a single job: both keys sit at the top, the two jobs below. Each provider keeps its own model, so switching back and forth does not overwrite the other one's.
This commit is contained in:
@@ -60,13 +60,12 @@ class Pipeline(QObject):
|
||||
|
||||
try:
|
||||
self.stage.emit(t("Transcribing…"))
|
||||
target = conf.transcribe_target()
|
||||
raw = api.transcribe(
|
||||
target,
|
||||
wav_path,
|
||||
conf.openai_key(),
|
||||
model=conf["transcribe_model"],
|
||||
language=conf["language"],
|
||||
prompt=conf["transcribe_prompt"],
|
||||
base_url=conf["openai_base_url"],
|
||||
)
|
||||
|
||||
if conf["filter_hallucinations"] and vad.looks_like_hallucination(raw, duration):
|
||||
@@ -107,7 +106,7 @@ class Pipeline(QObject):
|
||||
"ts": time.strftime("%Y-%m-%d %H:%M:%S"),
|
||||
"duration": round(duration, 1),
|
||||
"elapsed": round(time.monotonic() - started, 1),
|
||||
"model": conf["transcribe_model"],
|
||||
"model": target.model,
|
||||
"cleanup_model": conf["cleanup_model"] if conf["cleanup_enabled"] else "",
|
||||
"cleanup_error": warning,
|
||||
"raw": raw,
|
||||
|
||||
Reference in New Issue
Block a user