Skip to content

Commit 71be554

Browse files
committed
fix: stalled ingesters in non-interactive mode
1 parent f0ff801 commit 71be554

File tree

5 files changed

+20
-8
lines changed

5 files changed

+20
-8
lines changed

ingesters/src/ingesters/AsciiDocIngester.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ export abstract class AsciiDocIngester extends BaseIngester {
237237
sections.forEach((section: ParsedSection, index: number) => {
238238
const hash: string = calculateHash(section.content);
239239
const sourceLink = `${this.config.baseUrl}/${page.name}${this.config.urlSuffix}${section.anchor ? '#' + section.anchor : ''}`;
240-
console.log(
240+
console.debug(
241241
`Section Title: ${section.title}, source: ${this.source}, sourceLink: ${sourceLink}`,
242242
);
243243
chunks.push(

ingesters/src/ingesters/CairoBookIngester.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { MarkdownIngester } from './MarkdownIngester';
33
import { type BookChunk, DocumentSource } from '../types';
44
import { Document } from '@langchain/core/documents';
55
import { VectorStore } from '../db/postgresVectorStore';
6+
import { type VectorStoreUpdateOptions } from '../utils/vectorStoreUtils';
67
import { logger } from '../utils/logger';
78
import * as fs from 'fs/promises';
89
import * as path from 'path';
@@ -110,7 +111,10 @@ export class CairoBookIngester extends MarkdownIngester {
110111
* Core Library specific processing based on the pre-summarized markdown file
111112
* @param vectorStore
112113
*/
113-
public override async process(vectorStore: VectorStore): Promise<void> {
114+
public override async process(
115+
vectorStore: VectorStore,
116+
options?: VectorStoreUpdateOptions,
117+
): Promise<void> {
114118
try {
115119
// 1. Read the pre-summarized documentation
116120
const text = await this.readSummaryFile();
@@ -123,7 +127,7 @@ export class CairoBookIngester extends MarkdownIngester {
123127
);
124128

125129
// 3. Update the vector store with the chunks
126-
await this.updateVectorStore(vectorStore, chunks);
130+
await this.updateVectorStore(vectorStore, chunks, options);
127131

128132
// 4. Clean up any temporary files (no temp files in this case)
129133
await this.cleanupDownloadedFiles();

ingesters/src/ingesters/CoreLibDocsIngester.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { MarkdownIngester } from './MarkdownIngester';
55
import { type BookChunk, DocumentSource } from '../types';
66
import { Document } from '@langchain/core/documents';
77
import { VectorStore } from '../db/postgresVectorStore';
8+
import { type VectorStoreUpdateOptions } from '../utils/vectorStoreUtils';
89
import { logger } from '../utils/logger';
910
import { calculateHash } from '../utils/contentUtils';
1011
import {
@@ -114,7 +115,10 @@ export class CoreLibDocsIngester extends MarkdownIngester {
114115
* Core Library specific processing based on the pre-summarized markdown file
115116
* @param vectorStore
116117
*/
117-
public override async process(vectorStore: VectorStore): Promise<void> {
118+
public override async process(
119+
vectorStore: VectorStore,
120+
options?: VectorStoreUpdateOptions,
121+
): Promise<void> {
118122
try {
119123
// 1. Read the pre-summarized documentation
120124
const text = await this.readCorelibSummaryFile();
@@ -127,7 +131,7 @@ export class CoreLibDocsIngester extends MarkdownIngester {
127131
);
128132

129133
// 3. Update the vector store with the chunks
130-
await this.updateVectorStore(vectorStore, chunks);
134+
await this.updateVectorStore(vectorStore, chunks, options);
131135

132136
// 4. Clean up any temporary files (no temp files in this case)
133137
await this.cleanupDownloadedFiles();

ingesters/src/ingesters/StarknetBlogIngester.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { MarkdownIngester } from './MarkdownIngester';
33
import { type BookChunk, DocumentSource } from '../types';
44
import { Document } from '@langchain/core/documents';
55
import { VectorStore } from '../db/postgresVectorStore';
6+
import { type VectorStoreUpdateOptions } from '../utils/vectorStoreUtils';
67
import { logger } from '../utils/logger';
78
import * as fs from 'fs/promises';
89
import * as path from 'path';
@@ -111,7 +112,10 @@ export class StarknetBlogIngester extends MarkdownIngester {
111112
* Starknet Blog specific processing based on the pre-summarized markdown file
112113
* @param vectorStore
113114
*/
114-
public override async process(vectorStore: VectorStore): Promise<void> {
115+
public override async process(
116+
vectorStore: VectorStore,
117+
options?: VectorStoreUpdateOptions,
118+
): Promise<void> {
115119
try {
116120
// 1. Read the pre-summarized documentation
117121
const text = await this.readSummaryFile();
@@ -124,7 +128,7 @@ export class StarknetBlogIngester extends MarkdownIngester {
124128
);
125129

126130
// 3. Update the vector store with the chunks
127-
await this.updateVectorStore(vectorStore, chunks);
131+
await this.updateVectorStore(vectorStore, chunks, options);
128132

129133
// 4. Clean up any temporary files (no temp files in this case)
130134
await this.cleanupDownloadedFiles();

ingesters/src/utils/RecursiveMarkdownSplitter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ export class RecursiveMarkdownSplitter {
950950
}
951951
}
952952

953-
console.log(`Chunk Title: ${title}, Source link: ${sourceLink}`);
953+
console.debug(`Chunk Title: ${title}, Source link: ${sourceLink}`);
954954

955955
chunks.push({
956956
content: rawChunk.content,

0 commit comments

Comments
 (0)