Skip to content

Commit 54f41e5

Browse files
committed
New proposal: External command calls to allow LLMs to experiment and learn
1 parent d7e82bd commit 54f41e5

File tree

3 files changed

+81
-0
lines changed

3 files changed

+81
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- [Examples](#examples)
1717
- [Planned Features](#planned-features)
1818
- [Future Enhancements](#future-enhancements)
19+
- [Proposals](#proposals)
1920
- [Related](#related)
2021

2122
## What is CEDARScript?
@@ -430,6 +431,9 @@ This approach could potentially enhance LLMs' ability to leverage external tools
430431

431432
</details>
432433

434+
# Proposals
435+
See [current proposals](proposals/)
436+
433437
# Related
434438

435439
1. [.QL](https://en.wikipedia.org/wiki/.QL) - Object-oriented query language that enables querying Java source code using SQL-like syntax;

proposals/README.md

Whitespace-only changes.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# External command calls to allow LLMs to experiment and learn
2+
3+
## Summary
4+
I propose a language extension to `CEDARScript` to allow arbitrary command execution.
5+
It would work as an escape hatch that connects the LLM to the external environment.
6+
7+
Security implications aside, it holds a lot of potential.
8+
9+
The firs application could be a benchmark to see if the LLM would be able to perform better than the baseline
10+
when solving complex mathematical challenges, e. g. https://epoch.ai/frontiermath
11+
12+
## Examples
13+
14+
```sql
15+
-- Capturing script output
16+
17+
CALL LANGUAGE "python"
18+
WITH CONTENT r'''
19+
import os
20+
print(os.environ)
21+
''';
22+
23+
CALL COMMAND
24+
WITH CONTENT r'''
25+
#!/usr/bin/python3 -B -O
26+
import sys
27+
print(sys.version)
28+
''';
29+
30+
CALL COMMAND
31+
-- ENV MODE (ISOLATED* | INHERIT ONLY | INHERIT ALL)
32+
ENV MODE INHERIT ONLY 'PATH, HOME, API_KEY'
33+
-- ENV (r'''<env-spec>''' | FILE "<path>")
34+
ENV r'''
35+
OUTPUT_FORMAT=xml
36+
MAX_RESULTS=20
37+
'''
38+
CAPTURE STDOUT -- CAPTURE (*ALL | STDOUT | STDERR)
39+
-- WITH (CONTENT r'''<string>''' | FILE "<path>")
40+
WITH CONTENT r'''
41+
#!/bin/bash
42+
43+
echo $PATH
44+
echo $HOME
45+
echo $API_KEY $MAX_RESULTS
46+
curl http://something.com/
47+
''';
48+
49+
```
50+
51+
## Syntax in EBNF
52+
53+
```
54+
call_command ::=
55+
| 'CALL' 'COMMAND' [env_spec] with_clause
56+
| 'CALL' 'LANGUAGE' string_literal [env_spec] with_clause
57+
58+
env_spec ::= [env_mode_clause] [env_clause] [capture_clause]
59+
60+
env_mode_clause ::= 'ENV' 'MODE' (
61+
| 'ISOLATED' (* Default *)
62+
| 'INHERIT' 'ALL'
63+
| 'INHERIT' 'ONLY' string_literal (* Comma-separated list *)
64+
)
65+
66+
env_clause ::= 'ENV' (
67+
| raw_string_literal (* Multiline env vars *)
68+
| 'FILE' string_literal (* Load from file *)
69+
)
70+
71+
capture_clause ::= 'CAPTURE' ('ALL' | 'STDOUT' | 'STDERR')
72+
73+
with_clause ::= 'WITH' (
74+
| 'CONTENT' raw_string_literal (* Inline script with optional shebang *)
75+
| 'FILE' string_literal (* Script file with optional shebang *)
76+
)
77+
```

0 commit comments

Comments
 (0)