-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresearch.weave
More file actions
26 lines (20 loc) · 773 Bytes
/
Copy pathresearch.weave
File metadata and controls
26 lines (20 loc) · 773 Bytes
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
// research.weave
// Real tool-use. The researcher agent DECLARES a tool (web_search), so its soft
// call runs a ReAct loop: the model calls web_search as many times as it needs,
// Weave runs the real tool and feeds results back, then the agent answers.
//
// With --backend mock the model does not call tools (it just answers). With a
// real backend (claude/gemini) it actually drives the tool.
tool web_search(query: text) -> list<text>
agent researcher {
model: claude
tools: [web_search]
retry: 2
}
flow research(topic: text) -> text {
require topic != ""
researcher("Research {topic} using web_search, then give the single most useful fact in one sentence.") -> finding: text
ensure finding != ""
ensure finding.length <= 200
return finding
}