mirror of
https://github.com/bendtherules/ask262.git
synced 2026-08-18 13:21:55 +00:00
chore: Type-check fixes
This commit is contained in:
@@ -2,12 +2,12 @@ import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import * as cheerio from "cheerio";
|
||||
import { glob } from "glob";
|
||||
import { Graph } from "graphology";
|
||||
import Graph from "graphology";
|
||||
|
||||
const SPEC_DIR = "./spec-built/multipage";
|
||||
const CODE_DIR = "./engine262/src";
|
||||
|
||||
import { GRAPH_FILE } from "../constants.ts";
|
||||
import { GRAPH_FILE } from "../constants";
|
||||
|
||||
async function buildGraph() {
|
||||
const graph = new Graph({ multi: true });
|
||||
|
||||
+3
-3
@@ -19,7 +19,7 @@ Settings.embedModel = new OllamaEmbedding({
|
||||
const SPEC_DIR = "./spec-built/multipage";
|
||||
const _CODE_DIR = "./engine262/src";
|
||||
|
||||
import { STORAGE_DIR } from "../constants.ts";
|
||||
import { STORAGE_DIR } from "../constants";
|
||||
|
||||
// Initialize a SentenceSplitter with even smaller chunk size
|
||||
const sentenceSplitter = new SentenceSplitter({
|
||||
@@ -29,7 +29,7 @@ const sentenceSplitter = new SentenceSplitter({
|
||||
|
||||
async function ingestSpec() {
|
||||
const htmlFiles = await glob(path.join(SPEC_DIR, "*.html"));
|
||||
const documents = [];
|
||||
const documents: Document[] = [];
|
||||
|
||||
for (const file of htmlFiles) {
|
||||
const content = fs.readFileSync(file, "utf-8");
|
||||
@@ -97,7 +97,7 @@ async function main() {
|
||||
console.log("Building index (this might take a while with local Ollama)...");
|
||||
|
||||
const BATCH_SIZE = 50;
|
||||
let index;
|
||||
let index: any;
|
||||
|
||||
// Try to load existing index if any
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user