Path: blob/main/extensions/copilot/src/extension/prompts/node/panel/gitBranch.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 GitBranchPromptProps extends BasePromptElementProps {10userRequest: string;11}1213export class GitBranchPrompt extends PromptElement<GitBranchPromptProps> {14override render() {15return (16<>17<SystemMessage priority={1000}>18You 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 />19<SafetyRules />20<ResponseTranslationRules />21The branch name should not be wrapped in quotes. It should be between 8-50 characters.<br />22Here are some examples of good branch names:<br />23- linkedlist-implementation<br />24- adding-tree-view<br />25- react-usestate-hook-usage26</SystemMessage>27<UserMessage priority={900}>28Please write a brief branch name for the following request:<br />29<br />30{this.props.userRequest}31</UserMessage>32</>);33}34}353637