This commit is contained in:
jif-oai
2026-05-07 17:10:51 +01:00
parent 4892ea4e53
commit 22068b02b6
2 changed files with 6 additions and 6 deletions
@@ -38,7 +38,7 @@ fn main() {
// Build the prompt
let prompt_fragments = registry
.prompt_contributors()
.context_contributors()
.iter()
.flat_map(|contributor| contributor.contribute(&root_context))
.collect::<Vec<_>>();
+5 -5
View File
@@ -91,7 +91,7 @@ impl<C> ExtensionRegistryBuilder<C> {
pub fn build(self) -> ExtensionRegistry<C> {
ExtensionRegistry {
approval_interceptor_contributors: self.approval_interceptor_contributors,
prompt_contributors: self.context_contributors,
context_contributors: self.context_contributors,
tool_contributors: self.tool_contributors,
output_contributors: self.output_contributors,
}
@@ -100,10 +100,10 @@ impl<C> ExtensionRegistryBuilder<C> {
/// Immutable typed registry produced after extensions are installed.
pub struct ExtensionRegistry<C> {
approval_interceptor_contributors: Vec<Arc<dyn ApprovalInterceptorContributor<C>>>,
prompt_contributors: Vec<Arc<dyn ContextContributor<C>>>,
context_contributors: Vec<Arc<dyn ContextContributor<C>>>,
tool_contributors: Vec<Arc<dyn ToolContributor<C>>>,
output_contributors: HashMap<TypeId, Box<dyn Any + Send + Sync>>,
approval_interceptor_contributors: Vec<Arc<dyn ApprovalInterceptorContributor<C>>>,
}
impl<C> ExtensionRegistry<C> {
@@ -115,8 +115,8 @@ impl<C> ExtensionRegistry<C> {
}
/// Returns the registered prompt contributors.
pub fn prompt_contributors(&self) -> &[Arc<dyn ContextContributor<C>>] {
&self.prompt_contributors
pub fn context_contributors(&self) -> &[Arc<dyn ContextContributor<C>>] {
&self.context_contributors
}
/// Returns the registered native tool contributors.