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

context_servers: Return messages from prompts/get #17794

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dsp-ant
Copy link
Contributor

@dsp-ant dsp-ant commented Sep 13, 2024

This is a change in protocol. Since the protocol is marked as experimental, we don't just yet bump the version. We now return messages with user or assistant roles from prompt/get. In zed, we do the 'easy' thing at the moment and create a simple text that says Assistant:/User: respectively. The right fix would be to change the way we render slash command and allow for proper User/Assistant labels. I chose to not do this here, as it's a complicated change that likely needs to bake longer and I likely need help from someone at Zed to implement it.

The reasoning behind changing this, as this in the future would allow to nicely move complete existing conversations between Zed, e.g. claude.ai, which i think would be very useful in the future, e.g. imagine a world where someone create an artifact in claude.ai and pulls it into Zed + conversation.

Release Notes:

  • N/A

The underlying protocol now allows for returning messages with roles.
We need to reflect this appropriately.
Since slash commands don't fully support writing proper messages
with roles into the assistant panel just yet, we need to just write it
out in text for now. Most likely, we only receive user messages anywhere,
which we special case and insert directly without a role.
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Sep 13, 2024
@as-cii
Copy link
Member

as-cii commented Sep 19, 2024

For posterity, @dsp-ant @nathansobo and I chatted about this and the idea is to restructure the SlashCommand API. When running a command, we want to return a stream of SlashCommandEvents. An event can start a new message, start/end a section, or emit text.

This will make slash commands feel more responsive thanks to streaming, and it will allow inserting arbitrary message boundaries in a context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants