mirror of
https://github.com/yusufipk/dikte.git
synced 2026-09-11 19:06:11 +00:00
Report the effective speech language on the finished run
This commit is contained in:
+6
-4
@@ -146,6 +146,10 @@ class Pipeline(QObject):
|
|||||||
|
|
||||||
text = raw
|
text = raw
|
||||||
warning = ""
|
warning = ""
|
||||||
|
# The language the run actually spoke, reported to the window, the
|
||||||
|
# clipboard path and the history alike: the detected code, or the
|
||||||
|
# configured one when nothing was detected to replace it.
|
||||||
|
speech_language = detected or conf["language"]
|
||||||
# Remembered rather than re-derived at the history write below: the
|
# Remembered rather than re-derived at the history write below: the
|
||||||
# ask path runs cleanup under a different setting, and the record
|
# ask path runs cleanup under a different setting, and the record
|
||||||
# should say what happened, not what one of the two gates implies.
|
# should say what happened, not what one of the two gates implies.
|
||||||
@@ -195,9 +199,7 @@ class Pipeline(QObject):
|
|||||||
"question": question,
|
"question": question,
|
||||||
"assistant": assistant.provider(conf) if ask else "",
|
"assistant": assistant.provider(conf) if ask else "",
|
||||||
"assistant_model": assistant.model(conf) if ask else "",
|
"assistant_model": assistant.model(conf) if ask else "",
|
||||||
# The language the run actually spoke: the detected code, or the
|
"speech_language": speech_language,
|
||||||
# configured one when nothing was detected to replace it.
|
|
||||||
"speech_language": detected or conf["language"],
|
|
||||||
"raw": raw,
|
"raw": raw,
|
||||||
"text": text,
|
"text": text,
|
||||||
}
|
}
|
||||||
@@ -236,7 +238,7 @@ class Pipeline(QObject):
|
|||||||
time.sleep(0.35)
|
time.sleep(0.35)
|
||||||
paste.copy_bytes(previous)
|
paste.copy_bytes(previous)
|
||||||
|
|
||||||
self.finished.emit(raw, text, warning, detected)
|
self.finished.emit(raw, text, warning, speech_language)
|
||||||
|
|
||||||
except assistant.Cancelled:
|
except assistant.Cancelled:
|
||||||
self.cancelled.emit()
|
self.cancelled.emit()
|
||||||
|
|||||||
Reference in New Issue
Block a user