8 collapsed lines
/// Builds the agent. All tools run through `executor`, whose working directory is the repo.pub fn build( llm: &(impl ChatCompletion + Clone + 'static), executor: Arc<dyn ToolExecutor>, task: &ReleaseTask, github_tools: Option<impl ToolBox + 'static>,) -> Result<Agent> { let mut builder = Agent::builder(); builder .llm(llm) .context(DefaultContext::from_executor(executor))2 collapsed lines
.system_prompt(task.system_prompt(github_tools.is_some())) // Our own `stop` tool replaces the default one; call this before `tools`. .without_default_stop_tool() .tools([ git_log_since(), git_diff(), read_file(), // Drafts that describe a change twice go back to the model before anyone reviews them. OneEntryPerChange::new(ApprovalRequired::new(WriteChangelog::new(&task.notes_file))) .into(), ReleaseNotes::stop_tool().into(), ]) .limit(STEP_LIMIT);9 collapsed lines
if let Some(github_tools) = github_tools { builder.add_toolbox(github_tools); } progress::report_tool_calls(&mut builder); progress::stream_draft(&mut builder);
Ok(builder.build()?)}Release notes agent
Reads git, drafts the notes, and writes them only after you say yes.
→ stop (version 0.34.0: highlights 2, breaking 1, fixes 1)