( prefix: string, highlighted: string, suffix: string, llm: ILLM, userInput: string, language: string | undefined, )
| 27 | import { recursiveStream } from "./recursiveStream"; |
| 28 | |
| 29 | function constructEditPrompt( |
| 30 | prefix: string, |
| 31 | highlighted: string, |
| 32 | suffix: string, |
| 33 | llm: ILLM, |
| 34 | userInput: string, |
| 35 | language: string | undefined, |
| 36 | ): string | ChatMessage[] { |
| 37 | const template = llm.promptTemplates?.edit ?? gptEditPrompt; |
| 38 | return llm.renderPromptTemplate(template, [], { |
| 39 | userInput, |
| 40 | prefix, |
| 41 | codeToEdit: highlighted, |
| 42 | suffix, |
| 43 | language: language ?? "", |
| 44 | }); |
| 45 | } |
| 46 | |
| 47 | function constructApplyPrompt( |
| 48 | originalCode: string, |
no test coverage detected