mirror of
https://github.com/fbarrca/obsidian-inlineAI.git
synced 2026-07-22 11:50:24 +00:00
Enhance system prompt to include Obsidian-flavored markdown and add example for table conversion
This commit is contained in:
parent
87626146bd
commit
aebb6f844e
1 changed files with 18 additions and 3 deletions
21
src/api.ts
21
src/api.ts
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue