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