feat: solution for 'Экзамен: RAG-агент с ChromaDB и веб-поиском'

This commit is contained in:
2026-06-30 00:39:05 +03:00
parent d6805973d6
commit c55f307e12
6 changed files with 226 additions and 26 deletions
+15
View File
@@ -0,0 +1,15 @@
import fetch from "node-fetch";
export async function fetchWebContent(url) {
try {
const response = await fetch(url);
if (!response.ok) {
throw new Error(`HTTP error ${response.status}`);
}
const text = await response.text();
return text;
} catch (err) {
console.error(`Failed to fetch ${url}: ${err.message}`);
return "";
}
}