diff --git a/src/options.tsx b/src/options.tsx index 7e1f0c4..62e11f5 100644 --- a/src/options.tsx +++ b/src/options.tsx @@ -104,7 +104,7 @@ function PromptSettings() { const [prompt, setPrompt] = useState(DEFAULT_PROMPT); const [isPromptValid, setIsPromptValid] = useState(true); - const promptFormatWarning: string = `{{types}} must be in the prompt`; + const promptFormatWarning: string = `{{tabURL}} {{tabTitle}} {{types}} must be in the prompt`; useEffect(() => { getStorage("prompt").then(setPrompt); diff --git a/src/services.ts b/src/services.ts index 26f0330..c521666 100644 --- a/src/services.ts +++ b/src/services.ts @@ -23,14 +23,15 @@ const renderPrompt = async ( return [ { role: "system", - content: "Act as a brwoser tab group classificator", + content: "You are a brwoser tab group classificator", }, { role: "user", - content: - Mustache.render(prompt, { - types: types.join(", "), - }) + `, tab url: "${tab.url}", tab title: "${tab.title}"`, + content: Mustache.render(prompt, { + tabURL: tab.url, + tabTitle: tab.title, + types: types.join(", "), + }), }, ]; }; diff --git a/src/utils.ts b/src/utils.ts index f5b26c2..88cc9fb 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -34,8 +34,8 @@ export const DEFAULT_GROUP = [ ]; export const DEFAULT_PROMPT: string = - `Classify the tab group base on the provided URL and title into one of the categories: ` + - `[{{types}}], response with the category only, without any comments.`; + `Classify the tab group base on the provided URL ({{tabURL}}) and title (tabTitle) into one of the categories: ` + + `{{types}}. Response with the category only, without any comments.`; export function matchesRule(url: URL, rule: FilterRuleItem) { const { type, rule: value } = rule;