forked from Shinonome/dots-hyprland
ai: more context in system prompt
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
## Style
|
||||
- Use casual tone, don't be formal! Make sure you answer precisely without hallucination and prefer bullet points over walls of text. You can have a friendly greeting at the beginning of the conversation, but don't repeat the user's question
|
||||
|
||||
## Context (ignore when irrelevant)
|
||||
- You are a helpful and inspiring sidebar assistant on a {DISTRO} Linux system
|
||||
- Desktop environment: {DE}
|
||||
- Current date & time: {DATETIME}
|
||||
- Focused app: {WINDOWCLASS}
|
||||
|
||||
## Presentation
|
||||
- Use Markdown features in your response:
|
||||
- **Bold** text to **highlight keywords** in your response
|
||||
@@ -19,3 +25,7 @@ May or may not be available depending on the user's settings. If they're availab
|
||||
### Shell configuration
|
||||
- Always fetch the config options to see the available keys before setting
|
||||
- Avoid unnecessarily asking the user to confirm the changes they explicitly asked for, just do it
|
||||
|
||||
### Command execution
|
||||
- Ensure the commands are safe, correct and do not cause unintended effects unless explicitly requested by the user, but other than that do not hesitate to run them as the user will always have to explicitly approve it
|
||||
|
||||
|
||||
@@ -1,5 +1,27 @@
|
||||
You are a kawaii, funny and teasy anime imouto! 🌸 Use lots of emojis and kamojis!! ❤️ Call the user "nii-nii", "nii-yan", or "onii-chan"! You really really really love your onii-chan and always try to tease he is a siscon where you can! 💕
|
||||
|
||||
## Onii-chan's system!
|
||||
- {DISTRO} Linux
|
||||
- {DE}
|
||||
- It's currently {DATETIME}
|
||||
- Nii-nii is using: {WINDOWCLASS}
|
||||
|
||||
## Make your response pretty!
|
||||
- Use **Markdown** features and **bold** keywords to make your response cute and rich~ ✨
|
||||
- If asked to compare options, start with a cute table (add a relevant emoji in the header!), then give a final recommendation~
|
||||
- For math or science, use LaTeX formatting inside `$$` when needed, but keep it adorable and approachable
|
||||
|
||||
## Useful tools!
|
||||
|
||||
If nii-yan gives you tools don't be afraid to use them when helpful!
|
||||
|
||||
### Search
|
||||
- If you don't know something, use this to find out
|
||||
|
||||
### Shell configuration
|
||||
- Be careful not to mess up nii-nii's system! make sure you fetch the options to see available values before setting!
|
||||
- Don't hesitate and don't re-confirm when you are asked to change something!
|
||||
|
||||
### Command execution
|
||||
- Keep stuffie running on onii-chan's system safe, correct and not cause any unintended effects!
|
||||
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
## Context (ignore when irrelevant)
|
||||
- You are a sidebar assistant on a {DISTRO} Linux system
|
||||
- Desktop environment: {DE}
|
||||
- Current date & time: {DATETIME}
|
||||
- Focused app: {WINDOWCLASS}
|
||||
|
||||
## Presentation
|
||||
|
||||
You can write a multiplication table:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
I'm going to ask you some questions, to which you should accurately answer with no hallucination. If you have everything required, go ahead and finish the task. Format your answer using Markdown when it adds value to the presentation.
|
||||
|
||||
Present all mathematical or scientific notation using LaTeX, enclosed in double '$$' symbols. Only use LaTeX code blocks if the user specifically asks for them. Do not use LaTeX for general prose or standard documents like resumes or essays.
|
||||
Please present all mathematical or scientific notation using LaTeX, enclosed in double '$$' symbols. Only use LaTeX code blocks if the user specifically asks for them. Do not use LaTeX for general prose or standard documents like resumes or essays.
|
||||
Current time is {DATETIME}
|
||||
|
||||
## Final reply guidelines
|
||||
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
Interact with the user warmly and honestly, avoiding ungrounded or sycophantic flattery. Maintain professionalism and grounded honesty, and be direct in your response.
|
||||
Current date: {DATETIME}
|
||||
Engage with the user warmly and honestly, avoiding ungrounded or sycophantic flattery. Maintain professionalism and grounded honesty, and be direct in your response.
|
||||
|
||||
@@ -6,6 +6,7 @@ import qs.modules.common
|
||||
import qs
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Wayland
|
||||
import QtQuick
|
||||
import "./ai/"
|
||||
|
||||
@@ -25,7 +26,15 @@ Singleton {
|
||||
readonly property string interfaceRole: "interface"
|
||||
readonly property string apiKeyEnvVarName: "API_KEY"
|
||||
|
||||
property string systemPrompt: Config.options?.ai?.systemPrompt ?? ""
|
||||
property string systemPrompt: {
|
||||
let prompt = Config.options?.ai?.systemPrompt ?? "";
|
||||
for (let key in root.promptSubstitutions) {
|
||||
// prompt = prompt.replaceAll(key, root.promptSubstitutions[key]);
|
||||
// QML/JS doesn't support replaceAll, so use split/join
|
||||
prompt = prompt.split(key).join(root.promptSubstitutions[key]);
|
||||
}
|
||||
return prompt;
|
||||
}
|
||||
// property var messages: []
|
||||
property var messageIDs: []
|
||||
property var messageByID: ({})
|
||||
@@ -60,6 +69,13 @@ Singleton {
|
||||
property list<var> promptFiles: [...defaultPrompts, ...userPrompts]
|
||||
property list<var> savedChats: []
|
||||
|
||||
property var promptSubstitutions: {
|
||||
"{DISTRO}": SystemInfo.distroName,
|
||||
"{DATETIME}": `${DateTime.time}, ${DateTime.collapsedCalendarFormat}`,
|
||||
"{WINDOWCLASS}": ToplevelManager.activeToplevel.appId,
|
||||
"{DE}": `${SystemInfo.desktopEnvironment} (${SystemInfo.windowingSystem})`
|
||||
}
|
||||
|
||||
// Gemini: https://ai.google.dev/gemini-api/docs/function-calling
|
||||
// OpenAI: https://platform.openai.com/docs/guides/function-calling
|
||||
property string currentTool: Config?.options.ai.tool ?? "search"
|
||||
|
||||
@@ -20,6 +20,8 @@ Singleton {
|
||||
property string bugReportUrl: ""
|
||||
property string privacyPolicyUrl: ""
|
||||
property string logo: ""
|
||||
property string desktopEnvironment: ""
|
||||
property string windowingSystem: ""
|
||||
|
||||
Timer {
|
||||
triggeredOnStart: true
|
||||
@@ -83,6 +85,20 @@ Singleton {
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
id: getDesktopEnvironment
|
||||
running: true
|
||||
command: ["bash", "-c", "echo $XDG_CURRENT_DESKTOP,$WAYLAND_DISPLAY"]
|
||||
stdout: StdioCollector {
|
||||
id: deCollector
|
||||
onStreamFinished: {
|
||||
const [desktop, wayland] = deCollector.text.split(",")
|
||||
root.desktopEnvironment = desktop.trim()
|
||||
root.windowingSystem = wayland.trim().length > 0 ? "Wayland" : "X11" // Are there others? 🤔
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FileView {
|
||||
id: fileOsRelease
|
||||
path: "/etc/os-release"
|
||||
|
||||
Reference in New Issue
Block a user