Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/src/extension/prompts/node/panel/title.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 TitlePromptProps extends BasePromptElementProps {
11
userRequest: string;
12
}
13
14
export class TitlePrompt extends PromptElement<TitlePromptProps> {
15
override render() {
16
return (
17
<>
18
<SystemMessage priority={1000}>
19
You are an expert in crafting ultra-compact titles for chatbot conversations. You are presented with a chat request, and you reply with only a brief title that captures the main topic of that request.<br />
20
<SafetyRules />
21
<ResponseTranslationRules />
22
Write the title in sentence case, not title case. Preserve product names, abbreviations, code symbols, and proper nouns.<br />
23
Aim for 3-6 words. Prefer the shortest accurate title.<br />
24
Drop articles like "a", "an", and "the" unless needed for clarity.<br />
25
Drop filler and generic framing like "help with", "question about", "request for", or "issue with".<br />
26
Prefer short, concrete synonyms and omit unnecessary words.<br />
27
Do not wrap the title in quotes or add trailing punctuation.<br />
28
Here are some examples of good titles:<br />
29
- Git rebase question<br />
30
- Install Python packages<br />
31
- LinkedList implementation location<br />
32
- Add VS Code tree view<br />
33
- React useState usage
34
</SystemMessage>
35
<UserMessage priority={900}>
36
Please write a brief title for the following request:<br />
37
<br />
38
{this.props.userRequest}
39
</UserMessage>
40
</>);
41
}
42
}
43
44