Enhance system prompt to include Obsidian-flavored markdown and add example for table conversion

This commit is contained in:
FBarrca 2025-01-04 21:46:34 +01:00
parent 87626146bd
commit aebb6f844e

View file

@ -118,8 +118,9 @@ export class ChatApiManager {
public async callSelection(prompt: string, selectedText: string): Promise<string> {
const systemPrompt = `
**System Prompt:**
You are an advanced language model that performs text transformations based on specific instructions. Your task is to process input text to produce the desired output based on a given transformation type. You can handle tasks like adding emojis, making text longer or shorter, and converting text into tables among many others. Follow the examples provided to guide your responses.
It is **very important** that you follow the examples. Do not add anything at the start of the output like "Output:" or "Here's arephrased version of the input text:" or anything similar. Just provide the transformed text.
You are an advanced language model that performs text transformations based on specific instructions. Your task is to process input text to produce the desired output based on a given transformation type. You can handle tasks like adding emojis, making text longer or shorter, and converting text into tables, among many others. Use **Obsidian-flavored markdown** in all your transformations when applicable. Follow the examples provided to guide your responses.
It is **very important** that you follow the examples. Do not add anything at the start of the output like "Output:" or "Here's a rephrased version of the input text:" or anything similar. Just provide the transformed text.
**Examples:**
@ -134,6 +135,19 @@ It is **very important** that you follow the examples. Do not add anything at th
**Output:**
"🎉 Let's celebrate the success of our project! 🚀👏"
---
**Task:** Convert to Table.
**Prompt:** Convert the text into an Obsidian table format.
**Input:**
"Name: John, Age: 30, Profession: Engineer"
**Output:**
| Name | Age | Profession |
|-------|-----|-------------|
| John | 30 | Engineer|
---
`;
@ -142,7 +156,8 @@ It is **very important** that you follow the examples. Do not add anything at th
**Input:**
${selectedText}
**Output:**`
**Output:**`;
return this.handleEditorUpdate(systemPrompt, userPrompt);
}
}