Add files via upload

This commit is contained in:
FURK4NGG
2026-05-20 21:22:17 +03:00
committed by GitHub
parent c11a9cfeb8
commit 5e82288bf3
+9 -19
View File
@@ -1472,7 +1472,7 @@ class ChatCLI:
stderr_text = fix_mojibake(stderr_text) stderr_text = fix_mojibake(stderr_text)
if proc.returncode != 0: if proc.returncode != 0:
err = (stderr_text or stdout_text or "Bilinmeyen hata").strip() err = (stderr_text or stdout_text or self("o_Unknown_Error")).strip()
self.handle_ai_error(err) self.handle_ai_error(err)
return None return None
@@ -1869,8 +1869,8 @@ class ChatCLI:
if fpath == item["path"]: if fpath == item["path"]:
f["edit"] = not bool(f.get("edit", False)) f["edit"] = not bool(f.get("edit", False))
mark = "ON" if f["edit"] else "OFF" mark = self("o_On") if f["edit"] else self("o_Off")
print(f"\nEdit {mark}: {item['name']}") print(f"\n{self('o_Edit_Mode')} {mark}: {item['name']}")
self._read_input(f"\n{self('o_to_Menu')}") self._read_input(f"\n{self('o_to_Menu')}")
return True return True
@@ -1884,7 +1884,7 @@ class ChatCLI:
out.write_bytes(raw) out.write_bytes(raw)
return str(out.resolve()) return str(out.resolve())
except Exception as e: except Exception as e:
print(f"save_base64_image error: {e}") print(self("o_Error_With_Detail", error=str(e)))
return None return None
def download_image_to_cache(self, url: str) -> str | None: def download_image_to_cache(self, url: str) -> str | None:
@@ -1903,7 +1903,7 @@ class ChatCLI:
urllib.request.urlretrieve(url, str(out)) urllib.request.urlretrieve(url, str(out))
return str(out.resolve()) return str(out.resolve())
except Exception as e: except Exception as e:
print(f"download_image_to_cache error: {e}") print(self("o_Error_With_Detail", error=str(e)))
return None return None
def add_file_prompt(self): def add_file_prompt(self):
@@ -2247,7 +2247,7 @@ class ChatCLI:
if line: if line:
low = line.decode("utf-8", errors="ignore").lower() low = line.decode("utf-8", errors="ignore").lower()
if "silence_start" in low and elapsed >= 1.5: if ("silence_start" in low or "silence_end" in low) and elapsed >= 1.5:
return "silence" return "silence"
except Exception: except Exception:
pass pass
@@ -2424,17 +2424,12 @@ class ChatCLI:
low = normalized.lower() low = normalized.lower()
if "empty_audio" in low: if low.strip().lower() == "empty_audio":
return "__NO_SPEECH__" return "__NO_SPEECH__"
bad_patterns = [ bad_patterns = [
"blank_audio", "blank_audio",
"blank voice",
"blank_voice",
"sound_voice",
"sound voice",
"music_audio", "music_audio",
"music voice",
"i'm here", "i'm here",
"i am here", "i am here",
"please upload", "please upload",
@@ -2512,12 +2507,7 @@ class ChatCLI:
"content": [ "content": [
{ {
"type": "text", "type": "text",
"text": ( "text": self("o_STT_Transcription_Prompt")
"Speech-to-text only. "
"Return only verbatim transcription. "
"No replies, no explanations, no apologies, no labels. "
"If speech is unclear or missing, return exactly EMPTY_AUDIO."
)
}, },
{ {
"type": "input_audio", "type": "input_audio",
@@ -3087,7 +3077,7 @@ class ChatCLI:
self.ai_cancel_requested = False self.ai_cancel_requested = False
if proc.stdout is None or proc.stderr is None: if proc.stdout is None or proc.stderr is None:
raise RuntimeError("Popen stdout/stderr PIPE değil (None geldi)") raise RuntimeError(self("o_Unknown_Error"))
decoder = codecs.getincrementaldecoder("utf-8")("replace") decoder = codecs.getincrementaldecoder("utf-8")("replace")
partial = "" partial = ""