mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-10-07 02:58:15 +00:00
Try a better enhanced prompt prompt
This commit is contained in:
parent
64702e94f6
commit
621655aacb
3 changed files with 2 additions and 18 deletions
|
|
@ -127,22 +127,6 @@ export class Cline {
|
|||
}
|
||||
}
|
||||
|
||||
async enhancePrompt(promptText: string): Promise<string> {
|
||||
if (!promptText) {
|
||||
throw new Error("No prompt text provided")
|
||||
}
|
||||
|
||||
const prompt = `Generate an enhanced version of this prompt (reply with only the enhanced prompt, no bullet points): ${promptText}`
|
||||
|
||||
// Check if the API handler supports completePrompt
|
||||
if (this.api instanceof OpenRouterHandler) {
|
||||
return this.api.completePrompt(prompt)
|
||||
}
|
||||
|
||||
// Otherwise just return the prompt as is
|
||||
return prompt;
|
||||
}
|
||||
|
||||
// Storing task to disk for history
|
||||
|
||||
private async ensureTaskDirectoryExists(): Promise<string> {
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ describe('enhancePrompt', () => {
|
|||
await enhancePrompt(mockApiConfig, inputPrompt)
|
||||
|
||||
expect(mockHandler.completePrompt).toHaveBeenCalledWith(
|
||||
'Generate an enhanced version of this prompt (reply with only the enhanced prompt, no other text or bullet points): Test prompt'
|
||||
'Generate an enhanced version of this prompt (reply with only the enhanced prompt - no conversation, explanations, lead-in, bullet points, placeholders, or surrounding quotes):\n\nTest prompt'
|
||||
)
|
||||
})
|
||||
})
|
||||
|
|
@ -21,6 +21,6 @@ export async function enhancePrompt(apiConfiguration: ApiConfiguration, promptTe
|
|||
throw new Error("Expected OpenRouter handler")
|
||||
}
|
||||
|
||||
const prompt = `Generate an enhanced version of this prompt (reply with only the enhanced prompt, no other text or bullet points): ${promptText}`
|
||||
const prompt = `Generate an enhanced version of this prompt (reply with only the enhanced prompt - no conversation, explanations, lead-in, bullet points, placeholders, or surrounding quotes):\n\n${promptText}`
|
||||
return handler.completePrompt(prompt)
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue