File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+ """
3+ Analyze pasted article content from stdin using the LLM tech-article analyzer.
4+
5+ Usage:
6+ pbpaste | python analyze_tech_content.py
7+ python analyze_tech_content.py < article.txt
8+ """
9+
10+ import json
11+ import sys
12+
13+ from analyze_tech_article import build_user_message , call_llm
14+ from utils import LLMS_ANALYTICS_MODEL
15+
16+ def main ():
17+ content = sys .stdin .read ().strip ()
18+ if not content :
19+ print ("Error: no content received on stdin" , file = sys .stderr )
20+ sys .exit (1 )
21+
22+ extracted = {
23+ "url" : "" ,
24+ "title" : "" ,
25+ "description" : "" ,
26+ "text_markdown" : content ,
27+ }
28+
29+ user_message = build_user_message (extracted )
30+ result = call_llm (user_message , LLMS_ANALYTICS_MODEL )
31+ print (json .dumps (result , indent = 2 ))
32+
33+ print ("\n ---\n " )
34+ print (result .get ("summary" ))
35+
36+ if __name__ == "__main__" :
37+ main ()
You can’t perform that action at this time.
0 commit comments