Tighten branch name generation to 2 words with lower token limit and zero temperature
This commit is contained in:
parent
05dd4f1806
commit
e860d6ff57
|
|
@ -76,7 +76,7 @@ function fallbackBranchName(text: string): string {
|
||||||
.replace(/[^a-z0-9\s-]/g, "")
|
.replace(/[^a-z0-9\s-]/g, "")
|
||||||
.trim()
|
.trim()
|
||||||
.split(/\s+/)
|
.split(/\s+/)
|
||||||
.slice(0, 5)
|
.slice(0, 2)
|
||||||
.join("-")
|
.join("-")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -99,8 +99,9 @@ async function branchFromPrompt(text: string): Promise<string> {
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
model: "claude-haiku-4-5-20251001",
|
model: "claude-haiku-4-5-20251001",
|
||||||
max_tokens: 30,
|
max_tokens: 15,
|
||||||
messages: [{ role: "user", content: `Generate a short git branch name (2-4 lowercase words, hyphen-separated, no slashes) for this task:\n\n${text}\n\nOutput ONLY the branch name, nothing else.` }],
|
temperature: 0,
|
||||||
|
messages: [{ role: "user", content: `Generate a 2-word git branch name (lowercase, hyphen-separated) for this task:\n\n${text}\n\nOutput ONLY the branch name, nothing else.` }],
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user