mirror of
https://github.com/bendtherules/ask262.git
synced 2026-08-18 21:31:46 +00:00
chore(types) - Fix type checks
This commit is contained in:
@@ -42,7 +42,7 @@ export function createGraphExplorerTool(graph: Graph) {
|
||||
if (nodeAttr.file) result += `- File: ${nodeAttr.file}\n`;
|
||||
result += `\nConnected parts:\n`;
|
||||
|
||||
neighbors.forEach((neighbor) => {
|
||||
neighbors.forEach((neighbor: string) => {
|
||||
const attr = graph.getNodeAttributes(neighbor);
|
||||
const edges = graph.edges(nodeId, neighbor);
|
||||
const edgeAttr = graph.getEdgeAttributes(edges[0]);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Uses Ollama's reranker API to score documents against a query.
|
||||
*/
|
||||
|
||||
import { RERANKER_MODEL } from "../constants";
|
||||
import { RERANKER_MODEL } from "../constants.js";
|
||||
|
||||
const OLLAMA_HOST = process.env.OLLAMA_HOST || "http://localhost:11434";
|
||||
|
||||
|
||||
+2
-2
@@ -11,13 +11,13 @@ import {
|
||||
createGetSectionContentTool,
|
||||
createGraphExplorerTool,
|
||||
createSearchSpecSectionsTool,
|
||||
} from "./agent-tools";
|
||||
} from "./agent-tools/index.js";
|
||||
import {
|
||||
CONFIG_FILE,
|
||||
EMBEDDING_MODEL,
|
||||
GRAPH_FILE,
|
||||
STORAGE_DIR,
|
||||
} from "./constants";
|
||||
} from "./constants.js";
|
||||
|
||||
const embeddings = new OllamaEmbeddings({
|
||||
model: EMBEDDING_MODEL,
|
||||
|
||||
+3
-3
@@ -8,9 +8,9 @@ import { OllamaEmbeddings } from "@langchain/ollama";
|
||||
import * as cheerio from "cheerio";
|
||||
import { glob } from "glob";
|
||||
import ora from "ora";
|
||||
import { EMBEDDING_MODEL, SPEC_DIR, STORAGE_DIR } from "../constants";
|
||||
import { HTMLTextSplitter } from "./text-splitters";
|
||||
import { formatForIngestion } from "./utils/formatHTMLForIngestion";
|
||||
import { EMBEDDING_MODEL, SPEC_DIR, STORAGE_DIR } from "../constants.js";
|
||||
import { HTMLTextSplitter } from "./text-splitters/index.js";
|
||||
import { formatForIngestion } from "./utils/formatHTMLForIngestion.js";
|
||||
|
||||
const embeddings = new OllamaEmbeddings({
|
||||
model: EMBEDDING_MODEL,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
import { Document } from "@langchain/core/documents";
|
||||
import { HTMLTextSplitter } from "./index";
|
||||
import { HTMLTextSplitter } from "./index.js";
|
||||
|
||||
describe("HTMLTextSplitter", () => {
|
||||
test("keeps small HTML in a single chunk", async () => {
|
||||
|
||||
@@ -1 +1 @@
|
||||
export * from "./HtmlTextSplitter";
|
||||
export * from "./HtmlTextSplitter.js";
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
convertTablesToMarkdown,
|
||||
DEFAULT_CONFIG,
|
||||
formatForIngestion,
|
||||
} from "./formatHTMLForIngestion";
|
||||
} from "./formatHTMLForIngestion.js";
|
||||
|
||||
describe("formatHTMLForIngestion", () => {
|
||||
describe("convertLinksToMarkdown", () => {
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
|
||||
import * as lancedbSdk from "@lancedb/lancedb";
|
||||
import { OllamaEmbeddings } from "@langchain/ollama";
|
||||
import { createSearchSpecSectionsTool } from "../../agent-tools";
|
||||
import { EMBEDDING_MODEL, STORAGE_DIR } from "../../constants";
|
||||
import { createSearchSpecSectionsTool } from "../../agent-tools/index.js";
|
||||
import { EMBEDDING_MODEL, STORAGE_DIR } from "../../constants.js";
|
||||
|
||||
async function main() {
|
||||
// Get query from command line or use default
|
||||
@@ -43,7 +43,7 @@ async function main() {
|
||||
console.log("✓ Tool created\n");
|
||||
|
||||
console.log("Executing tool...\n");
|
||||
const result = await searchSpecSectionsTool.func({ query });
|
||||
const result = await searchSpecSectionsTool({ query });
|
||||
|
||||
console.log("=== TOOL OUTPUT ===");
|
||||
console.log(result);
|
||||
|
||||
@@ -21,7 +21,7 @@ import type { Table } from "@lancedb/lancedb";
|
||||
import * as lancedbSdk from "@lancedb/lancedb";
|
||||
import { OllamaEmbeddings } from "@langchain/ollama";
|
||||
import { Command } from "commander";
|
||||
import { EMBEDDING_MODEL, STORAGE_DIR } from "../../constants";
|
||||
import { EMBEDDING_MODEL, STORAGE_DIR } from "../../constants.js";
|
||||
|
||||
const embeddings = new OllamaEmbeddings({
|
||||
model: EMBEDDING_MODEL,
|
||||
|
||||
Reference in New Issue
Block a user