Skip to content

Commit beca927

Browse files
Add ingestion API functions and models for Code and Documentation
This commit introduces new API functions for establishing relations, inserting batches, and purging the database, enhancing the ingestion process. Additionally, it adds models for Code and Documentation, including their properties and relations, to improve type safety and organization. Import paths have been updated to reflect the new structure, ensuring consistency across the codebase.
1 parent 2e34ea0 commit beca927

File tree

17 files changed

+21
-20
lines changed

17 files changed

+21
-20
lines changed

ingestion/src/lib/api/establish-relations.ts renamed to ingestion/src/api/establish-relations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { RC_APP_URI } from "@/core/constants"
2-
import { CodeModelRelation } from "@/lib/models/code"
2+
import { CodeModelRelation } from "@/models/code"
33

44
export async function establishRelations(relations: CodeModelRelation[]): Promise<boolean> {
55
try {
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { RC_APP_URI } from "@/core/constants"
2-
import { CodeModel } from "@/lib/models/code"
2+
import { CodeModel } from "@/models/code"
3+
import { DocumentationModel } from "@/models/devdoc"
34

4-
export async function insertBatch(batchID: string, nodes: CodeModel[]): Promise<boolean> {
5+
export async function insertBatch(batchID: string, nodes: (CodeModel | DocumentationModel)[]): Promise<boolean> {
56
let tries = 5
67
while (tries--) {
78
try {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TreeNode } from "../../process/prepare/processor/core/treeNode"
1+
import { TreeNode } from "@/process/prepare/processor/core/treeNode"
22
import { BaseNode, BaseRelation, EmbeddingsContainer, NodeDescriptor } from "."
33

44
export type CodeModelRelation = BaseRelation

ingestion/src/process/documentation/documentation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import puppeteer from "puppeteer"
22

33
import { writeFile } from "fs/promises"
4-
import { DOCUMENTATION_URL } from "../../core/constants"
5-
import { DocumentationModel } from "../../lib/models/devdoc"
4+
import { DOCUMENTATION_URL } from "@/core/constants"
5+
import { DocumentationModel } from "@/models/devdoc"
66
import { IDocumentation } from "./documentation.types"
77
import { DocumentationPage } from "./documentationPage"
88

ingestion/src/process/documentation/documentationPage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { JSDOM } from "jsdom"
22

33
import { customAlphabet } from "nanoid"
4-
import { DocumentationModel } from "@/lib/models/devdoc"
4+
import { DocumentationModel } from "@/models/devdoc"
55
import { DocumentPageElement_t, IDocumentationPage } from "./documentationPage.types"
66

77
export class DocumentationPage implements IDocumentationPage {

0 commit comments

Comments
 (0)