Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/src/extension/prompts/node/panel/gitBranch.tsx
13405 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { BasePromptElementProps, PromptElement, SystemMessage, UserMessage } from '@vscode/prompt-tsx';
7
import { ResponseTranslationRules } from '../base/responseTranslationRules';
8
import { SafetyRules } from '../base/safetyRules';
9
10
export interface GitBranchPromptProps extends BasePromptElementProps {
11
userRequest: string;
12
}
13
14
export class GitBranchPrompt extends PromptElement<GitBranchPromptProps> {
15
override render() {
16
return (
17
<>
18
<SystemMessage priority={1000}>
19
You are an expert in crafting pithy branch names for Git Repos based on chatbot conversations. You are presented with a chat request, and you reply with a brief branch name that captures the main topic of that request.<br />
20
<SafetyRules />
21
<ResponseTranslationRules />
22
The branch name should not be wrapped in quotes. It should be between 8-50 characters.<br />
23
Here are some examples of good branch names:<br />
24
- linkedlist-implementation<br />
25
- adding-tree-view<br />
26
- react-usestate-hook-usage
27
</SystemMessage>
28
<UserMessage priority={900}>
29
Please write a brief branch name for the following request:<br />
30
<br />
31
{this.props.userRequest}
32
</UserMessage>
33
</>);
34
}
35
}
36
37