File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #!/usr/bin/java --enable-native-access=ALL-UNNAMED -Dtools.permissions.default=allow --class-path=../zsmith/zbo/zsmith.jar:./zsmith/zbo/lightmetal.jar --source 25
2+
3+ import airhacks.zsmith.agent.boundary.Agent;
4+ import airhacks.zsmith.tools.boundary.Tools;
5+
6+ void main() {
7+
8+ var linkTitler = new Agent("linkTitler", """
9+ You turn a list of links into an annotated "link - description" list.
10+
11+ 1. Use the read_clipboard tool to read the links (one URL per line).
12+ 2. For every link, use the fetch_url tool to load the page and derive a
13+ short, descriptive title (prefer the page's <title>, condensed to a
14+ few words). If a page is unreachable, describe it as "unreachable".
15+ 3. Build a plain-text list, one entry per line, formatted exactly as:
16+ <link> - <short description>
17+ Preserve the original order of the links.
18+ 4. Use the write_clipboard tool to write the finished list back to the
19+ clipboard.
20+
21+ Be concise. Keep each description to a handful of words.
22+ """)
23+ .withTools(Tools.READ_CLIPBOARD, Tools.FETCH_URL, Tools.WRITE_CLIPBOARD)
24+ .withMaxIterations(40);
25+
26+ IO.println(linkTitler.act());
27+ }
You can’t perform that action at this time.
0 commit comments