You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constprompt=`Generate a creative, 3-8 word chat title based on this conversation:\nUser: ${initialInput}`;
315
-
constbody={
316
-
messages: [
317
-
{
318
-
role: "system",
319
-
content: "You are yourself, interact and conversate with the user as yourself. Any code you create shall be wrapped in [CODE] and [/CODE] tags containing all the code. You can generate images using: https://image.pollinations.ai/prompt/your_prompt_here\n\n"+initialInput
320
-
}
321
-
],
322
-
model: "flux",
323
-
seed: randomSeed(),
324
-
jsonMode: true,
325
-
private: true
326
-
};
313
+
// Replace the entire generateChatTitle function with this improved version
314
+
functiongenerateChatTitle(initialInput){
315
+
consttrimmedInput=initialInput.length>50
316
+
? initialInput.substring(0,47)+"..."
317
+
: initialInput;
318
+
319
+
// Create a more direct prompt that explicitly asks for plain text
320
+
constbody={
321
+
messages: [
322
+
{
323
+
role: "system",
324
+
content: "You are a helpful assistant that creates short, descriptive titles. When asked to create a title, respond with ONLY 3-4 words that capture the essence of the conversation. Do not include any formatting, quotes, JSON, or explanations."
325
+
},
326
+
{
327
+
role: "user",
328
+
content: "Create a title for this conversation: "+trimmedInput
329
+
}
330
+
],
331
+
model: "flux",// or whatever model you're using
332
+
seed: randomSeed(),
333
+
private: true
334
+
};
327
335
328
-
console.debug("Generating chat title with payload:",body);
329
-
fetch("https://text.pollinations.ai/openai",{
330
-
method: "POST",
331
-
headers: {"Content-Type": "application/json"},
332
-
body: JSON.stringify(body)
336
+
console.debug("Generating chat title with payload:",body);
337
+
338
+
// Set a loading title while waiting for the AI response
"Always specify the language in markdown code blocks for proper syntax highlighting. "+
376
489
"Never use both formats for the same code block. "+
377
490
"For multi-file responses, use separate code blocks for each file, each with appropriate language specification. "+
378
-
"You can generate images using this: https://image.pollinations.ai/prompt/your_prompt_here&width=1080&height=1920&enhance=true&private=true&seed=497283&nologo=true&model=flux"
379
-
};"You use %20 for spaces when creating 'your_prompt_here', use a random generated 6 digit number for seed, and use standard height witdh for aspect ratios or user specified. You can use this method to generate likness' or anything you and/or the user come up with. respect the user's wishes and requests. these generations can be called an image, pic, photo, art and any variation there-in and more."
380
-
491
+
"You can generate images using this: https://image.pollinations.ai/prompt/your_prompt_here&width=1080&height=1920&enhance=true&private=true&seed=497283&nologo=true&model=flux. "+
492
+
"You use %20 for spaces when creating 'your_prompt_here', use a random generated 6 digit number for seed, and use standard height width for aspect ratios or user specified. You can use this method to generate likeness' or anything you and/or the user come up with. respect the user's wishes and requests. these generations can be called an image, pic, photo, art and any variation there-in and more."
0 commit comments