Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions chat-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,13 +506,13 @@ document.addEventListener("DOMContentLoaded", () => {
}

const model = (document.getElementById("model-select")?.value) || currentSession.model || "unity";
const apiUrl = `https://text.pollinations.ai/openai?model=${encodeURIComponent(model)}`;
const apiUrl = `https://text.pollinations.ai/openai?&model=${encodeURIComponent(model)}`;

try {
const res = await window.pollinationsFetch(apiUrl, {
method: "POST",
headers: { "Content-Type": "application/json", "Accept": "application/json" },
body: JSON.stringify({ messages, model })
body: JSON.stringify({ messages })
}, { timeoutMs: 45000 });
const data = await res.json();

Expand Down
14 changes: 9 additions & 5 deletions screensaver.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,22 +141,26 @@ document.addEventListener("DOMContentLoaded", () => {

async function fetchDynamicPrompt() {
const metaPrompt = "Generate unique, new, fucked up and explicit wild image prompts as text only of outlandish and psychologically thrilling images. ie demented, evil, psychotic art, under 125 characters.";
const token = encodeURIComponent(window.POLLINATIONS_TOKEN || "");
const apiUrl = `https://text.pollinations.ai/${encodeURIComponent(metaPrompt)}?model=unity${token ? `&token=${token}` : ""}`;
const apiUrl = `https://text.pollinations.ai/openai?&model=unity`;
try {
const response = await window.pollinationsFetch(apiUrl, {
method: "GET",
headers: { Accept: "text/plain" },
method: "POST",
headers: { "Content-Type": "application/json", Accept: "application/json" },
cache: "no-store",
body: JSON.stringify({
messages: [{ role: "user", content: metaPrompt }]
})
});
const generatedPrompt = await response.text();
const data = await response.json();
const generatedPrompt = data?.choices?.[0]?.message?.content;
if (!generatedPrompt) throw new Error("No prompt returned from API");
return generatedPrompt;
} catch (err) {
console.error("Failed to fetch dynamic prompt:", err);
throw err;
}
}

async function updatePrompt() {
if (!screensaverActive || paused || !autoPromptEnabled || isFetchingPrompt) {
return false;
Expand Down