Path: blob/main/extensions/copilot/src/extension/prompts/node/panel/title.tsx
13405 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { BasePromptElementProps, PromptElement, SystemMessage, UserMessage } from '@vscode/prompt-tsx';6import { ResponseTranslationRules } from '../base/responseTranslationRules';7import { SafetyRules } from '../base/safetyRules';89export interface TitlePromptProps extends BasePromptElementProps {10userRequest: string;11}1213export class TitlePrompt extends PromptElement<TitlePromptProps> {14override render() {15return (16<>17<SystemMessage priority={1000}>18You 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 />19<SafetyRules />20<ResponseTranslationRules />21Write the title in sentence case, not title case. Preserve product names, abbreviations, code symbols, and proper nouns.<br />22Aim for 3-6 words. Prefer the shortest accurate title.<br />23Drop articles like "a", "an", and "the" unless needed for clarity.<br />24Drop filler and generic framing like "help with", "question about", "request for", or "issue with".<br />25Prefer short, concrete synonyms and omit unnecessary words.<br />26Do not wrap the title in quotes or add trailing punctuation.<br />27Here are some examples of good titles:<br />28- Git rebase question<br />29- Install Python packages<br />30- LinkedList implementation location<br />31- Add VS Code tree view<br />32- React useState usage33</SystemMessage>34<UserMessage priority={900}>35Please write a brief title for the following request:<br />36<br />37{this.props.userRequest}38</UserMessage>39</>);40}41}424344