Skip to content

Conversation

@zakiali
Copy link
Collaborator

@zakiali zakiali commented Mar 28, 2025

This pr resolves this issue #1500 and removes tool result user annotations from the context (which may have been bloating the context)

Comment on lines 66 to 69
.filter(|c| {
if let Some(audience) = c.audience() {
!audience.contains(&Role::User)
} else {
true // Include if no audience annotation
}
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could also write this as:

.filter(|c| c.audience().map_or(true, |audience| !audience.contains(&Role::User)))

map_or would default to true in the None case, and run the filter otherwise

@zakiali zakiali force-pushed the zaki/bedrock-provider-fix branch from 9c38348 to 0e62b85 Compare March 28, 2025 18:24
@zakiali zakiali force-pushed the zaki/bedrock-provider-fix branch from 0e62b85 to 1b4d1f3 Compare March 28, 2025 21:07
@zakiali zakiali merged commit f72db13 into main Mar 28, 2025
6 checks passed
@zakiali zakiali deleted the zaki/bedrock-provider-fix branch March 28, 2025 21:20
ahau-square pushed a commit that referenced this pull request May 2, 2025
cbruyndoncx pushed a commit to cbruyndoncx/goose that referenced this pull request Jul 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants