agentram 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -2
- package/agentram/cli.py +35 -9
- package/package.json +1 -1
- package/pyproject.toml +1 -1
package/README.md
CHANGED
|
@@ -170,7 +170,7 @@ Run TUI:
|
|
|
170
170
|
agentram tui
|
|
171
171
|
```
|
|
172
172
|
|
|
173
|
-
Supported TUI slash commands:
|
|
173
|
+
Supported TUI slash commands. Plain text only records/retrieves RAM; use `/ask` to call bound models:
|
|
174
174
|
|
|
175
175
|
```text
|
|
176
176
|
/help
|
|
@@ -385,12 +385,13 @@ agentram_build_coding_orchestration
|
|
|
385
385
|
agentram_run_coding_orchestration
|
|
386
386
|
```
|
|
387
387
|
|
|
388
|
-
TUI slash commands:
|
|
388
|
+
TUI slash commands. Plain text only records/retrieves RAM; use `/ask` to call bound models:
|
|
389
389
|
|
|
390
390
|
```text
|
|
391
391
|
/bind-model claude claude-3-5-sonnet-latest role=reviewer api_key_env=ANTHROPIC_API_KEY
|
|
392
392
|
/models
|
|
393
393
|
/orchestrate review CLI orchestration
|
|
394
|
+
/ask xin chào
|
|
394
395
|
```
|
|
395
396
|
|
|
396
397
|
Storage:
|
|
@@ -844,3 +845,28 @@ Use `.env.example` as the shareable template.
|
|
|
844
845
|
- Model-based ingestion is best run through daemon/wrapper configuration.
|
|
845
846
|
- Wrapper CLI records command-level events, not deep internal agent tool events.
|
|
846
847
|
- Rich file/tool hooks need direct agent hooks or disciplined MCP calls.
|
|
848
|
+
|
|
849
|
+
|
|
850
|
+
### Why TUI May Not Respond Like A Model
|
|
851
|
+
|
|
852
|
+
Plain text in `agentram tui` records a user message and retrieves RAM context. It does not call paid/local models by default. To get a model response:
|
|
853
|
+
|
|
854
|
+
1. Put the real API key in an environment variable.
|
|
855
|
+
2. Bind the model using the env var name, not the raw key.
|
|
856
|
+
3. Use `/ask` or `agentram orchestrate --execute`.
|
|
857
|
+
|
|
858
|
+
Example:
|
|
859
|
+
|
|
860
|
+
```bash
|
|
861
|
+
set OPENAI_API_KEY=sk-your-key
|
|
862
|
+
agentram tui
|
|
863
|
+
```
|
|
864
|
+
|
|
865
|
+
Inside TUI:
|
|
866
|
+
|
|
867
|
+
```text
|
|
868
|
+
/bind-model openai-compatible Agentic --role coder --base-url http://localhost:8000/v1 --api-key-env OPENAI_API_KEY
|
|
869
|
+
/ask xin chào
|
|
870
|
+
```
|
|
871
|
+
|
|
872
|
+
Do not paste raw API keys into `/bind-model`. `api_key_env` means environment variable name, e.g. `OPENAI_API_KEY`.
|
package/agentram/cli.py
CHANGED
|
@@ -33,6 +33,7 @@ SLASH_HELP = """Slash commands:
|
|
|
33
33
|
/models List bound coding models
|
|
34
34
|
/bind-model provider model Bind model endpoint
|
|
35
35
|
/orchestrate <task> Build multi-model agent plan
|
|
36
|
+
/ask <prompt> Execute bound models and return outputs
|
|
36
37
|
/claude-install [path] Install .claude commands and agents
|
|
37
38
|
/note <text> Save decision note
|
|
38
39
|
/clear Clear chat
|
|
@@ -213,15 +214,14 @@ def handle_slash_command(context: McpContext, text: str, messages: list[str] | N
|
|
|
213
214
|
return models_text(context)
|
|
214
215
|
if command == "/bind-model":
|
|
215
216
|
if len(rest) < 2:
|
|
216
|
-
return "Usage: /bind-model <provider> <model> [role
|
|
217
|
-
|
|
218
|
-
for item in rest[2:]:
|
|
219
|
-
if "=" in item:
|
|
220
|
-
key, value = item.split("=", 1)
|
|
221
|
-
options[key.replace("-", "_")] = value
|
|
222
|
-
return bind_model_text(context, options)
|
|
217
|
+
return "Usage: /bind-model <provider> <model> [--role coder] [--base-url URL] [--api-key-env ENV_NAME]"
|
|
218
|
+
return bind_model_text(context, parse_bind_model_args(rest))
|
|
223
219
|
if command == "/orchestrate":
|
|
224
|
-
|
|
220
|
+
execute = "--execute" in rest
|
|
221
|
+
task = raw_rest.replace("--execute", "").strip()
|
|
222
|
+
return orchestrate_text(context, task, execute=execute)
|
|
223
|
+
if command == "/ask":
|
|
224
|
+
return orchestrate_text(context, raw_rest, execute=True)
|
|
225
225
|
if command == "/agent":
|
|
226
226
|
if not rest:
|
|
227
227
|
return "Usage: /agent <memory|planner|reviewer|documenter> <task>"
|
|
@@ -350,7 +350,32 @@ def models_text(context: McpContext) -> str:
|
|
|
350
350
|
return "\n".join(lines)
|
|
351
351
|
|
|
352
352
|
|
|
353
|
+
def parse_bind_model_args(parts: list[str]) -> dict[str, object]:
|
|
354
|
+
options: dict[str, object] = {"provider": parts[0], "model": parts[1]}
|
|
355
|
+
index = 2
|
|
356
|
+
while index < len(parts):
|
|
357
|
+
item = parts[index]
|
|
358
|
+
if item.startswith("--"):
|
|
359
|
+
key = item[2:].replace("-", "_")
|
|
360
|
+
if index + 1 < len(parts) and not parts[index + 1].startswith("--"):
|
|
361
|
+
options[key] = parts[index + 1]
|
|
362
|
+
index += 2
|
|
363
|
+
else:
|
|
364
|
+
options[key] = True
|
|
365
|
+
index += 1
|
|
366
|
+
elif "=" in item:
|
|
367
|
+
key, value = item.split("=", 1)
|
|
368
|
+
options[key.replace("-", "_")] = value
|
|
369
|
+
index += 1
|
|
370
|
+
else:
|
|
371
|
+
index += 1
|
|
372
|
+
return options
|
|
373
|
+
|
|
374
|
+
|
|
353
375
|
def bind_model_text(context: McpContext, options: dict[str, object]) -> str:
|
|
376
|
+
api_key_env = str(options.get("api_key_env", ""))
|
|
377
|
+
if api_key_env.startswith(("sk-", "gsk_", "sk_")):
|
|
378
|
+
return "Do not paste raw API key into api_key_env. Set env var first, e.g. OPENAI_API_KEY=sk-..., then use api_key_env=OPENAI_API_KEY."
|
|
354
379
|
modalities_value = str(options.get("modalities", "text"))
|
|
355
380
|
arguments = {
|
|
356
381
|
"id": str(options.get("id", "")) or None,
|
|
@@ -505,6 +530,7 @@ def sidebar_lines(context: McpContext) -> list[str]:
|
|
|
505
530
|
" /models",
|
|
506
531
|
" /bind-model claude <model>",
|
|
507
532
|
" /orchestrate <task>",
|
|
533
|
+
" /ask <prompt>",
|
|
508
534
|
]
|
|
509
535
|
|
|
510
536
|
|
|
@@ -515,7 +541,7 @@ def trim(text: str, limit: int) -> str:
|
|
|
515
541
|
def menu_lines() -> list[str]:
|
|
516
542
|
return [
|
|
517
543
|
"1=/init 2=/status 3=/retrieve 4=/goal 5=/set-goal 6=/drift 7=/events 8=/replay 9=/help",
|
|
518
|
-
"Plain text
|
|
544
|
+
"Plain text saves RAM only. Use /ask <prompt> to call bound models.",
|
|
519
545
|
]
|
|
520
546
|
|
|
521
547
|
|
package/package.json
CHANGED