Skip to content

Commit

Permalink
fixed getChapters prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurent Denoue committed Dec 22, 2024
1 parent 9828945 commit f606b0f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions code.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,14 +319,15 @@ async function llmChapters(text) {
}

async function getChapters(chunks, languageCode = 'en') {
const transcript = chunks.map(c => parseInt(c.start) + ': ' + c.text).join('\n')
let lines = chunks.map(c => parseInt(c.start) + ": " + c.text.trim())
let transcript = lines.join('\n')
const chaptersPrompt = `
- Please break down the following transcript into topic changes, providing a concise title for each section.
- Make sure the sections are not too short.
- Please write the titles in ${languageName(json, languageCode)}.
- Please return the result as a JSON array with 'title', 'start'.
Here is the text:
"""${transcript}"""`
${transcript}`
const result = await getJSONAnswer(chaptersPrompt)
if (!result)
return []
Expand Down

0 comments on commit f606b0f

Please sign in to comment.