-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathquiz.json
More file actions
65 lines (65 loc) · 2.91 KB
/
Copy pathquiz.json
File metadata and controls
65 lines (65 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
"lesson": "phase-11/16-langgraph-state-machines",
"questions": [
{
"stage": "post",
"question": "为什么 LangGraph State 的 TypedDict 中的 `messages` 字段需要 `Annotated[list, add_messages]`?",
"options": [
"它启用从模型流式传输 token 增量。",
"没有这个 reducer,节点更新会覆盖列表而不是追加,于是每一轮都会丢掉之前的历史。",
"它在把检查点(checkpoint)写入磁盘时压缩消息列表。",
"它在运行时把普通 dict 转换成 LangChain 消息对象。"
],
"correct": 1,
"explanation": ""
},
{
"stage": "post",
"question": "`interrupt_before=['tools']` 和 `interrupt_after=['tools']` 之间的区别是什么?",
"options": [
"没有区别;它们是别名。",
"`interrupt_before` 在模型发出 tool_calls 之后、但在工具执行之前暂停;`interrupt_after` 在工具已经运行之后暂停。",
"`interrupt_before` 先在沙箱里运行工具;`interrupt_after` 在生产中运行它。",
"`interrupt_before` 用于单元测试;`interrupt_after` 用于生产。"
],
"correct": 1,
"explanation": ""
},
{
"stage": "post",
"question": "给定一个线程的检查点历史,你如何时间旅行(time-travel)到某个先前状态并探索一个不同的分支?",
"options": [
"调用 `graph.reset(thread_id)` 然后 `graph.invoke(new_input, config)`。",
"删除检查点目录并用相同的 thread_id 重新调用。",
"用 config 中所需的先前 `checkpoint_id` 调用图;传 `None` 作为输入会从那个检查点重放,传入一个新值则会在恢复前把它追加进去。",
"设置 `graph.rewind = True` 并重新调用。"
],
"correct": 2,
"explanation": ""
},
{
"stage": "post",
"question": "在一个四节点的 ReAct 图(agent、tools、条件边、回到 agent 的静态边)中,条件边位于哪里?",
"options": [
"从 `tools` 回到 `agent`,根据工具输出是否为空进行路由。",
"从 `agent` 出发,如果最后一条消息有 tool_calls 就路由到 `tools`,否则路由到 `END`。",
"从 `START` 出发,根据输入长度路由到 `agent` 或 `END`。",
"没有条件边;两条都是静态的。"
],
"correct": 1,
"explanation": ""
},
{
"stage": "post",
"question": "什么时候应该使用 `Send(node_name, state)` 而不是普通的边?",
"options": [
"在失败后重试一个节点。",
"把一个节点推迟到计时器到期。",
"派发对某个目标节点的 N 个并行执行,其输出通过 state 的 reducer 合并回来。",
"在另一个进程中调用节点以实现隔离。"
],
"correct": 2,
"explanation": ""
}
]
}