mirror of
https://github.com/bendtherules/ask262.git
synced 2026-08-18 13:21:55 +00:00
fix(agent-tools, setup): standardize metadata keys to lowercase and update HTML ingestion
- Renamed `partIndex`/`totalParts` to `partindex`/`totalparts` in `section_retriever.ts`, `spec_retriever.ts`, and document creation logic. - Adjusted sorting logic to use the new `partindex` field. - Updated metadata handling and string interpolation to reference the lowercase keys. - Fixed import path for `HTMLTextSplitter` and moved the file to `setup/textsplitters/HtmlTextSplitter.ts`. - Added HTML preprocessing utilities (`addNewlinesAfterBlocks`, `convertTablesToMarkdown`) in ingestion workflow. - Integrated table-to‑markdown conversion and newline insertion to improve text splitting and document structure.
This commit is contained in:
@@ -41,10 +41,10 @@ export function createSectionRetrieverTool(table: Table) {
|
||||
.limit(100)
|
||||
.toArray();
|
||||
|
||||
// Sort by partIndex to maintain order (nulls last for single-part sections)
|
||||
// Sort by partindex to maintain order (nulls last for single-part sections)
|
||||
const sortedResults = results.sort((a: unknown, b: unknown) => {
|
||||
const aIndex = (a as { partIndex?: number }).partIndex ?? Infinity;
|
||||
const bIndex = (b as { partIndex?: number }).partIndex ?? Infinity;
|
||||
const aIndex = (a as { partindex?: number }).partindex ?? Infinity;
|
||||
const bIndex = (b as { partindex?: number }).partindex ?? Infinity;
|
||||
return aIndex - bIndex;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user