aboutsummaryrefslogtreecommitdiff
path: root/fetch-oneline-description
diff options
context:
space:
mode:
authordiogo464 <[email protected]>2025-07-24 09:12:43 +0100
committerdiogo464 <[email protected]>2025-07-24 09:12:43 +0100
commit647d05ff6b289e08752a6f58842bbceb7457b578 (patch)
tree582e79a86c01e534004bdae3a9c898f5038cd4e9 /fetch-oneline-description
parentdb5f5c98081315fa9efc3fcb3538f0a396e92c84 (diff)
show llm stderr on failure
Diffstat (limited to 'fetch-oneline-description')
-rwxr-xr-xfetch-oneline-description5
1 files changed, 4 insertions, 1 deletions
diff --git a/fetch-oneline-description b/fetch-oneline-description
index 6f592e681..731a34b84 100755
--- a/fetch-oneline-description
+++ b/fetch-oneline-description
@@ -21,11 +21,14 @@ class LLMClient:
21 proc = subprocess.run( 21 proc = subprocess.run(
22 ["llm", "-m", self.model, "-s", system_prompt, user_prompt], 22 ["llm", "-m", self.model, "-s", system_prompt, user_prompt],
23 timeout=30, 23 timeout=30,
24 check=True,
25 capture_output=True, 24 capture_output=True,
26 text=True, 25 text=True,
27 ) 26 )
28 stdout = proc.stdout.strip() 27 stdout = proc.stdout.strip()
28 stderr = proc.stderr.strip()
29 if proc.returncode != 0:
30 print(stderr)
31 proc.check_returncode()
29 return stdout 32 return stdout
30 33
31 def generate_description(self, text: str) -> str: 34 def generate_description(self, text: str) -> str: