Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions chat-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ async function apiFetch(url, options = {}, { timeoutMs = 45000 } = {}) {
}
window.apiFetch = apiFetch;

// Load global AI instructions from external text file
window.aiInstructions = "";
window.aiInstructionPromise = fetch("ai-instruct.txt")
.then(res => res.text())
.then(text => { window.aiInstructions = text; })
// Load global AI instructions from external markdown file
window.aiInstructions = "";
window.aiInstructionPromise = fetch("ai-instruct.md")
.then(res => res.text())
.then(text => { window.aiInstructions = text; })
.catch(err => {
console.error("Failed to load AI instructions", err);
window.aiInstructions = "";
Expand Down Expand Up @@ -464,13 +464,13 @@ document.addEventListener("DOMContentLoaded", () => {
chatBox.scrollTop = chatBox.scrollHeight;

if (!window.aiInstructions) {
try {
const res = await fetch("ai-instruct.txt", { cache: "no-store" });
window.aiInstructions = await res.text();
} catch (e) {
window.aiInstructions = "";
}
}
try {
const res = await fetch("ai-instruct.md", { cache: "no-store" });
window.aiInstructions = await res.text();
} catch (e) {
window.aiInstructions = "";
}
}

const messages = [];
if (window.aiInstructions) {
Expand Down
Loading