Andrew commited on
Commit
a1d1276
·
1 Parent(s): 6600478

refactor(server): update title generation to reduce instances of 'summary'

Browse files
src/lib/server/textGeneration/title.ts CHANGED
@@ -41,15 +41,14 @@ export async function generateTitle(prompt: string, modelId?: string, opts?: { a
41
 
42
  return await getReturnFromGenerator(
43
  generateFromDefaultEndpoint({
44
- messages: [{ from: "user", content: `Prompt to summarize: "${prompt}"` }],
45
  preprompt: `You are a titling assistant.
46
- Summarize the user's request into a short title of at most 4 words.
47
- Use the SAME language as the user's message.
48
- Do not answer the question.
49
- Do not include the word prompt into your response.
50
- Do not say "summarize" or "summary" in the title.
51
- Do not include quotes, emojis, hashtags or trailing punctuation.
52
- Return ONLY the title text.`,
53
  generateSettings: {
54
  max_tokens: 30,
55
  },
 
41
 
42
  return await getReturnFromGenerator(
43
  generateFromDefaultEndpoint({
44
+ messages: [{ from: "user", content: `Prompt to craft the title from: "${prompt}"` }],
45
  preprompt: `You are a titling assistant.
46
+ Create a natural, concise title (max 4 words) that reflects the user's request.
47
+ Use the same language as the user.
48
+ Never answer the request.
49
+ NEVER respond with the words “summary,” “summarize,” “prompt,” or any synonyms in the title.
50
+ No quotes, emojis, hashtags, or trailing punctuation.
51
+ Return only the title text.`,
 
52
  generateSettings: {
53
  max_tokens: 30,
54
  },