Skip to content

armgit / my-yt

Public Imported from GitHub
0

A clean and minimal youtube frontend, without all the ads and whistles

JavaScript

rename fetchCompletionLMSTUDIO

Christian Feia1d2f11715f6
diff --git a/lib/llm.js b/lib/llm.js
index 3417851..a347d22 100644
--- a/lib/llm.js
+++ b/lib/llm.js
@@ -1,5 +1,5 @@
-// export async function fetchAIResponseLMSTUDIO (system, prompt, model = "meta-llama-3-8b-instruct") {
-export async function fetchAIResponseLMSTUDIO (system, prompt, model = "llama-3.2-3b-instruct") {
+// export async function fetchCompletionLMSTUDIO (system, prompt, model = "meta-llama-3-8b-instruct") {
+export async function fetchCompletionLMSTUDIO (system, prompt, model = "llama-3.2-3b-instruct") {
if (prompt.length > 10000) prompt = prompt.substring(0, 10000)
try {
const response = await fetch('http://0.0.0.0:1234/v1/chat/completions', {
diff --git a/lib/subtitles-summary.js b/lib/subtitles-summary.js
index 3a45f74..b621470 100644
--- a/lib/subtitles-summary.js
+++ b/lib/subtitles-summary.js
@@ -1,6 +1,6 @@
import fs from "fs"
import { getVideoSubtitles } from "./youtube.js"
-import { fetchAIResponseLMSTUDIO } from "./llm.js"
+import { fetchCompletionLMSTUDIO } from "./llm.js"
export async function summarizeVideo(id, repo, callback = () => {}) {
const transcript = await getVideoSubtitles(id, callback)
@@ -16,7 +16,7 @@ Extract the key points from the following video transcript:
${cleanedTranscript.replace('\n', ' ')}`
const systemPrompt = "You're a helpful assistant that sumarizes a video transcript in max 10 sentences, extracting the key points"
- const summary = await fetchAIResponseLMSTUDIO(systemPrompt, userPrompt)
+ const summary = await fetchCompletionLMSTUDIO(systemPrompt, userPrompt)
repo.setVideoSummary(id, summary)
console.log('Download completed', summary)