feat: add embedchain javascript package (#576)

This commit is contained in:
Taranjeet Singh
2023-09-06 17:22:44 -07:00
committed by GitHub
parent f582d70031
commit 3c3d98b9c3
44 changed files with 20073 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
import type { Metadata } from './Metadata';
export type ChunkResult = {
documents: string[];
ids: string[];
metadatas: Metadata[];
};

View File

@@ -0,0 +1,10 @@
import type { ChunkResult } from './ChunkResult';
type Data = {
doc: ChunkResult['documents'][0];
meta: ChunkResult['metadatas'][0];
};
export type DataDict = {
[id: string]: Data;
};

View File

@@ -0,0 +1 @@
export type DataType = 'pdf_file' | 'web_page' | 'qna_pair';

View File

@@ -0,0 +1,3 @@
import type { Document } from 'langchain/document';
export type FormattedResult = [Document, number | null];

View File

@@ -0,0 +1,7 @@
import type { QnaPair } from './QnAPair';
export type RemoteInput = string;
export type LocalInput = QnaPair;
export type Input = RemoteInput | LocalInput;

View File

@@ -0,0 +1,3 @@
import type { Metadata } from './Metadata';
export type LoaderResult = { content: any; metaData: Metadata }[];

View File

@@ -0,0 +1,3 @@
export type Metadata = {
url: string;
};

View File

@@ -0,0 +1 @@
export type Method = 'init' | 'query' | 'add' | 'add_local';

View File

@@ -0,0 +1,4 @@
type Question = string;
type Answer = string;
export type QnaPair = [Question, Answer];

View File

@@ -0,0 +1,21 @@
import { DataDict } from './DataDict';
import { DataType } from './DataType';
import { FormattedResult } from './FormattedResult';
import { Input, LocalInput, RemoteInput } from './Input';
import { LoaderResult } from './LoaderResult';
import { Metadata } from './Metadata';
import { Method } from './Method';
import { QnaPair } from './QnAPair';
export {
DataDict,
DataType,
FormattedResult,
Input,
LoaderResult,
LocalInput,
Metadata,
Method,
QnaPair,
RemoteInput,
};