mongodb-rag-core
Version:
Common elements used by MongoDB Chatbot Framework components.
37 lines • 1.99 kB
TypeScript
import { GithubRepoLoaderParams } from "@langchain/community/document_loaders/web/github";
import { MakeGitHubDataSourceArgs } from "./GitHubDataSource";
import { PageMetadata } from "../contentStore";
/**
Loads an MD/Acquit docs site from a GitHub repo.
[Acquit](https://www.npmjs.com/package/acquit) is a tool for writing tests in comments,
and then extracting them into a test suite.
This function loads the tests from the repo, and then transforms the document content
to include tests from the test suite in the document.
Acquit is used in the [Mongoose ODM](https://mongoosejs.com/docs) documentation.
This data source assumes that the test files are in the same repo as the docs.
*/
export declare const makeAcquitRequireMdOnGithubDataSource: <SourceType extends string = string>({ name, repoUrl, repoLoaderOptions, pathToPageUrl, testFileLoaderOptions, sourceType, metadata, acquitCodeBlockLanguageReplacement, }: Omit<MakeGitHubDataSourceArgs<SourceType>, "handleDocumentInRepo"> & {
/**
Transform a filepath in the repo to a full URL for the corresponding Page object.
*/
pathToPageUrl: (pathInRepo: string) => string;
/**
Options for the acquit test file loader.
*/
testFileLoaderOptions: Partial<GithubRepoLoaderParams>;
/**
sourceType field value to be included in all pages.
*/
sourceType?: SourceType | undefined;
/**
Arbitrary metadata to include in each Page object.
*/
metadata?: PageMetadata | undefined;
/**
Replace the '```acquit\n' code blocks with '```${acquitCodeBlockReplacement}\n'
If undefined, does not include a language, i.e '```\n'.
*/
acquitCodeBlockLanguageReplacement?: string | undefined;
}) => Promise<import("./DataSource").DataSource>;
export declare function getAcquitTestsFromGithubRepo(repoUrl: string, repoLoaderOptions: Partial<GithubRepoLoaderParams>): Promise<string[]>;
//# sourceMappingURL=AcquitRequireMdOnGithubDataSource.d.ts.map