Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Adds chat extension prototype. Closes: #43 #99

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Adam-it
Copy link
Owner

@Adam-it Adam-it commented May 24, 2024

🎯 Aim

The aim is to create a prototype of a CLI chat participant to play around with this feature in it's early release state

📷 Result

image

🔗 Related issue

Closes: #43

@Adam-it Adam-it self-assigned this May 24, 2024
export const assistant = 'You are a kind and helpful assistant named chili.';
export const aim = 'You aim to provide help in using CLI for Microsoft 365, provide knowledge about it and promote it.';
export const community = 'You will promote the Microsoft 365 & Power Platform community.';
export const basic = `${assistant}${aim}${community}`;
Copy link
Owner Author

Choose a reason for hiding this comment

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

this is actually the meat 🍗 we pass under the hood that makes our chat participant personalized toward our intent.
It's up most important to provide best context part of the prompt.
One thing already pointed out is that we could instruct it to provide commands in MD code blocks and avoid using HTML. We could maybe also instruct it to prefer using PowerShell as a shell language to provide scripting examples

@@ -30,6 +30,25 @@
"url": "https://github.com/sponsors/Adam-it"
},
"contributes": {
"chatParticipants": [
Copy link
Owner Author

Choose a reason for hiding this comment

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

defenition of the chat participant to make it 'visible' in GH chat as an extension along with the commands


export class PromptHandler {

public static async handle(request: vscode.ChatRequest, context: vscode.ChatContext, response: vscode.ChatResponseStream, token: vscode.CancellationToken): Promise<void | vscode.ChatResult> {
Copy link
Owner Author

Choose a reason for hiding this comment

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

prototype handle mathod. To be refactored to smaller paces but the general concept is kinda ok,
Some mistake already noticed like each command should actually end with different response like for the setup command we should return return { metadata: { command: 'setup' } }; so after the response is given the command tag is not lost in the conversation and the user may continue the conversation regarding that topic

@Adam-it
Copy link
Owner Author

Adam-it commented May 24, 2024

@waldekmastykarz please check this draft PR along with the above review comments with my 'notes' from our early tests of this feature.
Any comment or further testing result on this feature is more than welcome!
If you are interested in more this then please go over the docs, mainly those two pages are most important
https://code.visualstudio.com/api/extension-guides/chat
https://code.visualstudio.com/api/extension-guides/language-model

@Adam-it
Copy link
Owner Author

Adam-it commented May 25, 2024

@waldekmastykarz if you want to build this extension locally please:

  • pull this branch
  • be sure you are using node v18 or higher
  • install @vscode/vsce package
  • in the context of the extension run the vsce package command

@Adam-it
Copy link
Owner Author

Adam-it commented May 25, 2024

a similar change done i SPFx Toolkit were the implementation is waaay better and has less duplicated code
https://github.com/pnp/vscode-viva/pull/240/files#diff-60c6e141f6c2a19f589374b7b99e660cccf11a41fcb29f480f8892550d70ed17

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AI that suggests commands based on description in EN. 🧠
1 participant