Skip to content

Commit

Permalink
add pre-instruction to prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
abeatrix committed Mar 25, 2024
1 parent a07e841 commit b0024c4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions vscode/src/edit/prompt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,14 @@ export const buildInteraction = async ({

const promptBuilder = new PromptBuilder(contextWindow)

const preamble = getSimplePreamble(model)
promptBuilder.tryAddToPrefix(preamble)

const preInstruction: string | undefined = vscode.workspace
.getConfiguration('cody.chat')
.get('preInstruction')
const preamble = getSimplePreamble(model, preInstruction)
promptBuilder.tryAddToPrefix(preamble)

const transcript: ChatMessage[] = [{ speaker: 'human', text: prompt }]
const editRule = preInstruction ? `\nIMPORTANT: ${preInstruction}` : ''
const transcript: ChatMessage[] = [{ speaker: 'human', text: prompt + editRule }]
if (assistantText) {
transcript.push({ speaker: 'assistant', text: assistantText })
}
Expand Down

0 comments on commit b0024c4

Please sign in to comment.