Spaces:
Running
Running
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
|
| 45 |
preprompt: `You are a titling assistant.
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 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 |
},
|