-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "refactor(tools): migrate to TypeScript and enhance build conf…
…iguration" This reverts commit 09887ef.
- Loading branch information
1 parent
dcac955
commit eea51a0
Showing
49 changed files
with
130 additions
and
3,626 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 5 additions & 10 deletions
15
...arch/rag/loaders/textInputLoader/index.ts → ...src/_utils/rag/loaders/textInputLoader.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,20 @@ | ||
import { BaseDocumentLoader } from '@langchain/core/document_loaders/base'; | ||
import { Document as BaseDocument } from 'langchain/document'; | ||
|
||
interface TextInputMetadata { | ||
[key: string]: any; | ||
} | ||
|
||
export class TextInputLoader extends BaseDocumentLoader { | ||
private text: string; | ||
private metadata: TextInputMetadata; | ||
|
||
constructor(text: string, metadata: TextInputMetadata = {}) { | ||
class TextInputLoader extends BaseDocumentLoader { | ||
constructor(text, metadata = {}) { | ||
super(); | ||
this.text = text; | ||
this.metadata = metadata; | ||
} | ||
|
||
async load(): Promise<BaseDocument[]> { | ||
async load() { | ||
const document = new BaseDocument({ | ||
pageContent: this.text, | ||
metadata: this.metadata, | ||
}); | ||
return [document]; | ||
} | ||
} | ||
|
||
export { TextInputLoader }; |
25 changes: 0 additions & 25 deletions
25
packages/tools/src/_utils/rag/loaders/textInputLoader/index.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.