feat(extractor): add with_agent_builder method for custom agent configuration#1357
feat(extractor): add with_agent_builder method for custom agent configuration#1357atellou wants to merge 4 commits into0xPlaygrounds:mainfrom
Conversation
…guration - Format mime_guess dependency declaration in Cargo.toml - Add gemini_rag example demonstrating RAG with structured extraction
|
To be honest we should probably really just re-combine the agent builders back together and have the tools thing as an enum so we don't have to deal with this. I'll open a sep issue to solve this |
|
If you merge I think at the moment it will be difficult to use tool server handles with this type currently (which means that using the |
|
Mmmmm got it, thanks for the fast response. In that case, shouldn't the toolchoice function be removed from the ExtractorBuilder? Also, for my use case I only need to enable RAG. If we enable the dynamic context function, would that be ok? |
Yeah that's fine. |
|
moved to this #1456 |
PR Description
Summary
This PR improves the ExtractorBuilder API by adding a closure-based customization hook that lets callers configure the underlying
AgentBuilderSimple(e.g.dynamic_context, temperature, max_tokens, etc.) while keeping the extractor’s opinionated defaults (preamble + requiredsubmittool).Problem
ExtractorBuilder is implemented on top of
AgentBuilder, but it only exposed a limited set of configuration methods. This made it awkward/impossible to reuse common agent configuration patterns (especially RAG viadynamic_context) when using extractors, and forced users toward workarounds.Solution
FnOnce(AgentBuilderSimple<M>) -> AgentBuilderSimple<M>gemini_ragexample to use .with_agent_builder(|agent| agent.dynamic_context(...)) to attach vector search context to the extractor.Tests
Examples
Notes
cargo test -p rig-core extractor_builder_with_agent_builder_applies_config --features derivepasses.