You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-15Lines changed: 27 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,23 +39,40 @@ Copy env example and fill out:
39
39
cp .env.example .env
40
40
```
41
41
42
-
Validate your config:
42
+
The fastest way to try AutoPrompt is with the multi-turn example — it runs entirely offline, no API key required for the agent itself:
43
43
44
44
```bash
45
-
autoprompt validate autoprompt.yaml
45
+
autoprompt run examples/multi_turn/autoprompt.yaml --dry-run
46
+
autoprompt run examples/multi_turn/autoprompt.yaml
46
47
```
47
48
48
-
Run in dry-run mode:
49
+
For a real LLM agent (requires `OPENROUTER_API_KEY`):
49
50
50
51
```bash
51
-
autoprompt run autoprompt.yaml --dry-run
52
+
autoprompt run examples/simple/autoprompt.yaml
52
53
```
53
54
54
-
Execute the optimization loop:
55
+
## Choosing an Adapter
55
56
56
-
```bash
57
-
autoprompt run autoprompt.yaml
58
-
```
57
+
AutoPrompt connects to your agent via one of three built-in adapters:
58
+
59
+
| Adapter | When to use | Config field |
60
+
|---|---|---|
61
+
|`python_callable`| Your agent is a Python function in the same repo |`import_path: "my_module:my_function"`|
62
+
|`http`| Your agent runs as an HTTP service |`endpoint: "http://localhost:8000/chat"`|
63
+
|`cli`| Your agent is a CLI tool that reads from stdin |`command: "python my_agent.py"`|
64
+
65
+
**You need a custom adapter** only when the built-in ones don't fit — for example, if your HTTP endpoint requires JWT authentication or a non-standard request format. Custom adapters subclass `AgentAdapter` from [`autoprompt/adapters/base.py`](autoprompt/adapters/base.py) and implement two methods: `send()` and `health_check()`.
66
+
67
+
### What your callable needs to accept
68
+
69
+
For `python_callable`, AutoPrompt calls your function with either:
| [`examples/simple/`](examples/simple/) | Minimal setup with a Python callable adapter |
112
-
| [`examples/multi_turn/`](examples/multi_turn/) | Multi-turn agent with offline mock (no API key needed) |
113
-
| [`examples/ora/`](examples/ora/) | HTTP adapter with custom JWT authentication |
114
-
115
-
## Creating Custom Adapters
116
-
117
-
If your agent runs inside Python without an HTTP endpoint, use `python_callable` or write a custom class subclassing `AgentAdapter` (see [`autoprompt/adapters/base.py`](autoprompt/adapters/base.py) and [`examples/ora/adapter.py`](examples/ora/adapter.py) for a pattern).
128
+
| [`examples/multi_turn/`](examples/multi_turn/) | Complete multi-turn agent — runs fully offline, no API key needed for the agent |
129
+
| [`examples/simple/`](examples/simple/) | Minimal single-turn LLM agent using `python_callable` |
0 commit comments