Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Marcelle/selective render #630

Open
wants to merge 5 commits into
base: v1.0
Choose a base branch
from
Open

Conversation

laanak08
Copy link
Collaborator

@laanak08 laanak08 commented Jan 16, 2025

This change allows "Goose" (not user, not assistant) to show information to the user which is outside of the user's conversation with the llm, and avoids sending those out-of-band messages to the llm.

ideally, visually, it would be nice to update the prompt so Goose-messages show as a third speaker.

changelist:

  • add role Goose
  • after truncation, create message to user from Role::Goose and append to the message history
  • filter out these Goose-messages before sending to llm-preprocessing
  • after llm response, render llm response, then render any goose response if one exists

this keeps the Goose messages in the message history.

@laanak08 laanak08 requested review from baxen and ahau-square January 16, 2025 17:14
Copy link

Desktop App for this PR

The following build is available for testing:

The app is signed and notarized for macOS. After downloading, unzip the file and drag the Goose.app to your Applications folder.

This link is provided by nightly.link and will work even if you're not logged into GitHub.

@ahau-square
Copy link
Collaborator

how do these messages render in the UI / CLI?

@laanak08
Copy link
Collaborator Author

laanak08 commented Jan 16, 2025

@ahau-square

how do these messages render in the UI / CLI?
its the last line of text

Screenshot 2025-01-16 at 12 13 13 PM As i said above though, i could work on giving it an icon so its clearly another speaker

@laanak08 laanak08 changed the title Marcelle/selective render feat: Marcelle/selective render Jan 16, 2025
@michaelneale
Copy link
Collaborator

yeah nice - would be nice in the GUI if it could have some goose like icon or prefix to make it clear it is a side channel message or just from goose? (optional though as most people won't necessarily know or care where it came from probably)

Copy link
Collaborator

@baxen baxen left a comment

Choose a reason for hiding this comment

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

Looks good, i like this solution! left a comment below on how we can filter these from model inference

&tools,
).await?;
capabilities.record_usage(usage).await;

// Yield the assistant's response
yield response.clone();

// if ctx limit added goose message yield it
Copy link
Collaborator

Choose a reason for hiding this comment

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

thinking through this, we need to make sure that the goose role messages never get to an LLM provider.

I think we can do that one of two ways:

  • make the agent filter the messages out before any provider calls
  • update the providers to filter (which i see you've done for anthropic but i think is missing from others?)

vaguely i think the former is a bit easier, maybe add a helper method on the capabilities struct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@baxen im updating the providers to filter goose-role messages, and its more involved than would be wise to do for tomorrow. im putting it in its own PR. ive found and updated all the providers to skip processing goose-role messages, but testing all of it will spill into next week.

.count_everything(system_prompt, messages, tools, &resources, model);

let mut new_messages = messages.to_vec();
if approx_count > target_limit {
let user_msg_size = self.text_content_size(new_messages.last(), model);
Copy link
Collaborator

Choose a reason for hiding this comment

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

are we sure we should take this out? was the intention here to catch if the user's message is too big itself to fit into the limit size? I think that's a reasonable edge case. But if we leave it in I think we'd have to filter to make sure the message checked is a user message

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.

4 participants