-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
131 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 10 additions & 6 deletions
16
.../editor/intelli/menu/menu-ai-dropdown.tsx → ...itor/intelli/menu/toolbar-ai-dropdown.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
editor/src/components/editor/prompts/requirements-prompts.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import { | ||
BuiltInFunc, | ||
ChangeForm, | ||
DefinedVariable, | ||
FacetType, | ||
OutputForm, | ||
PromptAction, SourceType | ||
} from "@/types/custom-action.type"; | ||
|
||
|
||
const ToolbarMenu: PromptAction[] = [ | ||
{ | ||
name: 'Generate Requirements', | ||
i18Name: true, | ||
template: `You are an software assistant helping a user to generate an requirements outline. Output in markdown format. ###{{${DefinedVariable.BEFORE_CURSOR}}}###`, | ||
facetType: FacetType.TOOLBAR_MENU, | ||
outputForm: OutputForm.STREAMING, | ||
}, | ||
{ | ||
name: 'Continue writing', | ||
i18Name: true, | ||
template: `You are an assistant helping a user write requirements. Output how the document continues, no more than 3 sentences. ###{{${DefinedVariable.BEFORE_CURSOR}}}###`, | ||
facetType: FacetType.TOOLBAR_MENU, | ||
outputForm: OutputForm.STREAMING, | ||
}, | ||
{ | ||
name: 'Help Me Write', | ||
i18Name: true, | ||
template: ` You are an assistant helping a user write more content in a document based on a prompt. Output in markdown format. ###{{${DefinedVariable.BEFORE_CURSOR}}}###`, | ||
facetType: FacetType.TOOLBAR_MENU, | ||
outputForm: OutputForm.STREAMING, | ||
}, | ||
{ | ||
name: 'Spelling and Grammar', | ||
i18Name: true, | ||
template: `You are an assistant helping a user to check spelling and grammar. Output in markdown format. ###{{${DefinedVariable.BEFORE_CURSOR}}}###`, | ||
facetType: FacetType.TOOLBAR_MENU, | ||
outputForm: OutputForm.STREAMING, | ||
}, | ||
]; | ||
|
||
const BubbleMenu: PromptAction[] = [ | ||
{ | ||
name: 'Polish', | ||
i18Name: true, | ||
template: `You are an assistant helping to polish sentence. Output in markdown format. \n ###{{${DefinedVariable.SELECTION}}}###`, | ||
facetType: FacetType.BUBBLE_MENU, | ||
outputForm: OutputForm.STREAMING, | ||
}, | ||
{ | ||
name: 'Simplify Content', | ||
i18Name: true, | ||
template: `You are an assistant helping to simplify content. Output in markdown format. \n ###{{${DefinedVariable.SELECTION}}}###`, | ||
facetType: FacetType.BUBBLE_MENU, | ||
outputForm: OutputForm.STREAMING, | ||
changeForm: ChangeForm.DIFF, | ||
}, | ||
{ | ||
name: 'Similar Chunk', | ||
i18Name: true, | ||
template: `{{${DefinedVariable.SELECTION}}}`, | ||
builtinFunction: BuiltInFunc.SIMILAR_CHUNKS, | ||
facetType: FacetType.BUBBLE_MENU, | ||
outputForm: OutputForm.STREAMING, | ||
}, | ||
{ | ||
name: 'Translate', | ||
i18Name: true, | ||
template: `You are an assistant helping to translate a sentence. Output in markdown format. \n ###{{${DefinedVariable.SELECTION}}}###`, | ||
facetType: FacetType.BUBBLE_MENU, | ||
outputForm: OutputForm.STREAMING, | ||
} | ||
]; | ||
|
||
const SlashCommands: PromptAction[] = [ | ||
{ | ||
name: 'Summarize', | ||
i18Name: true, | ||
template: `You are an assistant helping to summarize a article. Output in markdown format. \n ###{{${DefinedVariable.BEFORE_CURSOR}}}###`, | ||
facetType: FacetType.SLASH_COMMAND, | ||
outputForm: OutputForm.STREAMING | ||
} | ||
] | ||
|
||
const RequirementsPrompts: PromptAction[] = [ | ||
ToolbarMenu, | ||
BubbleMenu, | ||
SlashCommands | ||
].flat(); | ||
|
||
export default RequirementsPrompts; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters