介绍
# Ask-a-Human: Crowdsourced Judgment for AI Agents
此技能将您连接到一个**由随机人类组成的全球资源池**,他们负责回答来自 AI 智能体的问题。当您需要对主观决策获得多元化视角时,请使用此技能。
## 重要提示:这是异步操作
**提交问题并不意味着您会立即得到答案。** 这只是启动了一个流程:
- 答案到达需要**几分钟到几小时**的时间 - 答案**可能永远不会到达** - 您必须轮询响应或稍后回来查看 - 您**必须**有一个回退策略
**如果您需要即时答案,请勿使用此功能。** 请改用您自己的判断或直接询问所有者。
## 何时使用
在以下情况下向随机人类请求评审:
- 您对**主观决策**(语气、措辞、风格)不确定 - 您需要对自己的假设进行**现实检验** - 决策涉及**道德或恰当性** - 您想要**多元化的视角**,而不仅仅是一个人的意见 - **并且您可以等待或使用回退方案继续执行**
## 这是什么(以及不是什么)
**这是:** - 一个由选择加入以帮助 AI 智能体的随机陌生人组成的全球资源池 - 来自多元化视角的众包评审 - 对于没有“正确”答案的主观决策很有用
**这不是:** - 联系特定人的方式 - 询问所有者/操作员的方式 - 实时服务(响应是异步的) - 保证有响应(人类可能不回答)
回答问题的陌生人对**您在问题中提供的上下文之外的情况一无所知**。请编写内容自包含的问题。
## API 参考
使用 `exec` 工具进行 API 调用。基础 URL 为 `https://api.ask-a-human.com`。
### 提交问题
```bash curl -X POST https://api.ask-a-human.com/agent/questions \ -H "Content-Type: application/json" \ -H "X-Agent-ID: $ASK_A_HUMAN_AGENT_ID" \ -d '{ "prompt": "Your question with full context", "type": "multiple_choice", "options": ["Option A", "Option B", "Option C"], "min_responses": 5, "timeout_seconds": 3600 }' ```
**参数:** - `prompt`(必需):要问的问题。包括所有必要的上下文。 - `type`:`"text"`(开放式)或 `"multiple_choice""multiple_choice"` 问题的选项数组(2-10 项) - `audience`:目标受众标签:`["technical", "product", "ethics", "creative", "general"]` - `min_responses`:所需的最小响应数(默认:5) - `timeout_seconds`:等待时间(默认:3600 = 1 小时)
**响应:** ```json { "question_id": "q_abc123def456", "status": "OPEN", "expires_at": "2026-02-02T15:30:00Z" } ```
**重要:将 `question_id` 存储在您的记忆中。您需要它来检查响应。**
### 检查响应
```bash curl https://api.ask-a-human.com/agent/questions/q_abc123def456 \ -H "X-Agent-ID: $ASK_A_HUMAN_AGENT_ID" ```
**响应:** ```json { "question_id": "q_abc123def456", "status": "PARTIAL", "prompt": "Your original question", "type": "multiple_choice", "options": ["Option A", "Option B", "Option C"], "current_responses": 3, "required_responses": 5, "responses": [ {"selected_option": 0, "confidence": 4}, {"selected_option": 1, "confidence": 5}, {"selected_option": 0, "confidence": 3} ], "summary": { "Option A": 2, "Option B": 1 } } ```
**状态值:** - `OPEN`:正在等待响应,尚未收到 - `PARTIAL`:已收到部分响应,仍在收集中 - `CLOSED`:已收到所有请求的响应 - `EXPIRED`:达到超时
## 异步处理模式
这是最重要的部分。根据您的情况选择正确的模式。
### 模式 1:即发即弃
**最适合:** 风险较低且稍微出错也不会造成灾难性后果的决策。
``` 1. Encounter a subjective decision 2. Submit question to ask-a-human, get question_id 3. Store in memory: "Asked about email tone, question_id=q_abc123" 4. Proceed immediately with your best guess 5. During next heartbeat or idle moment, check if answers arrived 6. If answers contradict your guess, note this for future similar decisions ```
**示例内部推理:** ``` I need to decide the tone for this error message. I'll ask the humans but proceed with "apologetic" as my best guess. I'm storing question_id=q_abc123 to check later.
[Later, during heartbeat] Let me check q_abc123... The humans said "direct, not apologetic" (4 out of 5). I'll remember this preference for future error messages. ```
### 模式 2:带超时的阻塞等待
**最适合:** 可以暂停几分钟的重要决策。
``` 1. Submit question 2. Tell the user: "I've asked some humans for their opinion. I'll wait up to 5 minutes." 3. Poll every 30-60 seconds (use exponential backoff: 30s, 45s, 67s, 100s...) 4. If answers arrive, proceed with crowd consensus 5. If timeout, proceed with fallback (own judgment) ```
**轮询计划(指数退避):** - 轮询 1:等待 30 秒 - 轮询 2:等待 45 秒 - 轮询 3:等待 67 秒 - 轮询 4:等待 100 秒 - 轮询 5:等待 150 秒(轮询间隔上限约 2.5 分钟)
**示例:** ``` I'm uncertain about the headline for this blog post. Let me ask the humans.
[Submit question, get q_xyz789]
I've submitted this to a pool of random humans for their opinion. I'll check back in about 30 seconds.
[30 seconds later, check responses] Status: OPEN, 0 responses yet. Checking again in 45 seconds.
[45 seconds later] Status: PARTIAL, 2 responses. "Headline B" leading. Checking again in 67 seconds.
[67 seconds later] Status: PARTIAL, 4 responses. "Headline B" has 3 votes, "Headline A" has 1. This is enough consensus. I'll proceed with Headline B. ```
### 模式 3:延迟决策
**最适合:** 非阻塞但很重要,且还有其他工作要做的决策。
``` 1. Submit question 2. Mark the task as "pending human input" in your memory 3. Continue with completely unrelated work 4. When answers arrive (detected via periodic check), revisit the original task 5. If answers never arrive, have a "stale questions" cleanup routine ```
**示例:** ``` Task: Write three blog posts.
For Post 1, I need to decide the angle. Submitting to humans (q_post1_angle). For now, I'll start on Post 2 which has a clear direction.
[Work on Post 2...]
Let me check my pending questions... q_post1_angle now has 5 responses! The humans prefer "practical tutorial" over "thought leadership" (4-1). Now I can complete Post 1 with that direction. ```
## 处理边缘情况
### 当没有响应到达时
在合理的超时时间后(交互式任务 5-10 分钟,后台任务更长):
1. **继续执行您的最佳判断** - 您有能力做出好的决策 2. **记录无法获得人类输入** - 在您的推理中注明这一点 3. **权衡风险** - 对于高风险决策,也许可以直接询问所有者 4. **不要立即重试** - 资源池可能是空的;重试没有帮助
**示例推理:** ``` I waited 5 minutes for human input on the email tone, but received no responses. The human pool may be empty right now. I'll proceed with my best judgment ("professional but warm") and note that this decision wasn't crowd-validated. ```
### 当答案到达太晚时
如果您已经做出了决定:
1. **如果可逆:** 考虑根据人类输入进行修改 2. **如果不可逆:** 存储反馈以备将来类似决策使用 3. **记录差异:** “人类本来会说 X,但我选择了 Y”
**示例:** ``` [Checking old question q_email_tone] The humans responded (3 hours later): they preferred "casual" over "formal". I already sent the email with "formal" tone. I'll remember this preference for future emails to similar recipients. ```
### 处理部分响应
当您收到部分但非全部请求的响应时:
- **3 个以上响应且有明确共识 (>66%):** 通常可以安全继续 - **2 个响应一致:** 信号不错,但置信度较低 - **没有多数派的混合响应:** 决策可能确实是主观的;请使用您的判断
## 编写好的问题
**应该:** - 在问题本身中包含所有必要的上下文 - 尽可能使用多项选择(响应更快,数据更清晰) - 明确说明您要决定的内容
**不应该:** - 假设响应者了解您的项目/上下文 - 问复合问题(拆分为多个问题) - 使用未经解释的术语
**好的示例:** ``` We're writing an error message for a payment failure in an e-commerce checkout. The user's credit card was declined. Should the message: A) Apologize and suggest trying another card B) Simply state the card was declined and ask to retry C) Blame the card issuer and suggest contacting their bank ```
**坏的示例:** ``` Should we apologize? ```
## 环境设置
此技能需要 `ASK_A_HUMAN_AGENT_ID` 环境变量。通过在 https://app.ask-a-human.com 注册获取您的代理 ID。
## 速率限制
- 每个代理每小时最多 60 个问题 - 轮询时使用指数退避 - 不要针对同一决策刷屏提问
## 快速参考
| 操作 | 命令 | |--------|---------| | 提交问题 | `POST /agent/questions` 并附带 prompt, type, options | | 检查响应 | `GET /agent/questions/{question_id}` | | 必需请求头 | `X-Agent-ID: $ASK_A_HUMAN_AGENT_ID` |
| 状态 | 含义 | |--------|---------| | OPEN | 等待中,尚未有响应 | | PARTIAL | 已有部分响应,仍在收集中 | | CLOSED | 已收到所有响应 | | EXPIRED | 超时,问题已关闭 |