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: custom starter message configuration #963

Merged
merged 6 commits into from
Sep 8, 2023
Merged

feat: custom starter message configuration #963

merged 6 commits into from
Sep 8, 2023

Conversation

abeatrix
Copy link
Contributor

@abeatrix abeatrix commented Sep 7, 2023

RE: https://sourcegraph.slack.com/archives/C05AGQYD528/p1693983800785199

This PR adds a new configuration cody.chat.preInstruction to allow setting a custom starter message that will prepend chat requests to Cody:

  • Configuration now has a cody.chat.preInstruction string property.
  • A new setting cody.custom.starter was added in vscode/package.json to allow configuring a custom message.
  • getConfiguration() was updated to read the new customStarter config value.
  • ConfigurationWithAccessToken gained a customStarter property.
  • main.ts imports PromptMixin to set the custom starter message on extension start.

Test plan

  1. set cody.chat.preInstruction in your user config, e.g. "call me jeff"
  2. reload extension
  3. submit a chat request
  4. check the output channel to see your setting was added to the chat request
Screenshot 2023-09-06 at 9 03 38 PM

@abeatrix abeatrix requested review from toolmantim and a team September 7, 2023 04:15
@@ -811,6 +811,14 @@
"default": false,
"markdownDescription": "Experimental feature for internal use."
},
"cody.custom.starter": {
Copy link
Member

Choose a reason for hiding this comment

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

Many settings are grouped under feature categories (e.g., cody.autocomplete.* or cody.inlineChat.*). Would it make sense to apply this pattern here too?

Copy link
Contributor

@toolmantim toolmantim Sep 7, 2023

Choose a reason for hiding this comment

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

What about cody.chat.preInstruction with the description "An instruction to be included at the start of all chat messages sent to Cody"

That is assuming it's chat messages only?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea autocompletes uses a different prompt so this is only for chat

Copy link
Contributor

@toolmantim toolmantim left a comment

Choose a reason for hiding this comment

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

Great! I left a suggestion for a new config name.

@abeatrix abeatrix enabled auto-merge (squash) September 8, 2023 23:33
@abeatrix abeatrix merged commit e3b2754 into main Sep 8, 2023
10 checks passed
@abeatrix abeatrix deleted the bee/add-start branch September 8, 2023 23:50
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.

None yet

3 participants