紧凑的中间形式
对于冗长的自然语言输入,Arka 还会在发送给 LLM 之前,将你的文本转换为一种紧凑的中间表示。原始文本仍会用于符号路由、安全检查、精确命令识别和审计元数据。 紧凑形式会保留:- 高信号量的需求
- 少量上下文
- 字面的 URL、文件路径、代码块、JSON 以及 shell 命令
- 反幻觉约束
- 重复语句
- 低信号量的填充语
- 多余的空白
Task IR: 提示会跳过压缩。Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
让提示更清晰,在调用 LLM 前压缩冗长输入,同时保留用户的确切意图。
arka prompt_optimize "summarize this research paper" --rounds 3 --role "research assistant"
arka "optimize this prompt: explain the experiment and cite assumptions"
ARKA_PROMPT_OPTIMIZE=1
ARKA_PROMPT_COMPACT=1
ARKA_PROMPT_COMPACT_MIN_CHARS=900
ARKA_PROMPT_COMPACT_MAX_ITEMS=24
ARKA_PROMPT_COMPACT=0 arka ask "..."
arka llm complete --system "You are Arka" --user "..." --no-compact
Task IR: 提示会跳过压缩。