File tree 7 files changed +39
-2
lines changed
docs/docs/modules/indexes/retrievers
7 files changed +39
-2
lines changed Original file line number Diff line number Diff line change
1
+ # Remote Retriever
2
+
3
+ This example shows how to use the Metal Retriever in a ` RetrievalQAChain ` to retrieve documents from Metal index.
4
+
5
+ ## Setup
6
+
7
+ ``` bash npm2yarn
8
+ npm i @getmetal/metal-sdk
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ import CodeBlock from " @theme/CodeBlock" ;
14
+ import Example from " @examples/retrievers/metal.ts" ;
15
+
16
+ <CodeBlock language = " typescript" >{ Example } </CodeBlock >
Original file line number Diff line number Diff line change 1
1
# Remote Retriever
2
2
3
- This example shows how to use the a Remote Retriever in a ` RetrievalQAChain ` to retrieve documents from a remote server.
3
+ This example shows how to use a Remote Retriever in a ` RetrievalQAChain ` to retrieve documents from a remote server.
4
4
5
5
## Usage
6
6
File renamed without changes.
Original file line number Diff line number Diff line change 21
21
"license" : " MIT" ,
22
22
"dependencies" : {
23
23
"@dqbd/tiktoken" : " ^1.0.2" ,
24
+ "@getmetal/metal-sdk" : " ^1.0.12" ,
24
25
"@pinecone-database/pinecone" : " ^0.0.10" ,
25
26
"@supabase/supabase-js" : " ^2.10.0" ,
26
27
"chromadb" : " ^1.3.0" ,
Original file line number Diff line number Diff line change
1
+ import Metal from "@getmetal/metal-sdk" ;
2
+ import { MetalRetriever } from "langchain/retrievers" ;
3
+
4
+ export const run = async ( ) => {
5
+ const MetalSDK = Metal . default ;
6
+
7
+ const client = new MetalSDK (
8
+ process . env . METAL_API_KEY ! ,
9
+ process . env . METAL_CLIENT_ID ! ,
10
+ process . env . METAL_APP_ID
11
+ ) ;
12
+ const retriever = new MetalRetriever ( { client } ) ;
13
+
14
+ const docs = await retriever . getRelevantDocuments ( "hello" ) ;
15
+
16
+ console . log ( docs ) ;
17
+ } ;
Original file line number Diff line number Diff line change 325
325
"import" : " ./retrievers.js"
326
326
}
327
327
}
328
- }
328
+ }
Original file line number Diff line number Diff line change @@ -11407,6 +11407,7 @@ __metadata:
11407
11407
resolution: "langchain-examples@workspace:examples"
11408
11408
dependencies:
11409
11409
"@dqbd/tiktoken": ^1.0.2
11410
+ "@getmetal/metal-sdk": ^1.0.12
11410
11411
"@pinecone-database/pinecone": ^0.0.10
11411
11412
"@supabase/supabase-js": ^2.10.0
11412
11413
"@tsconfig/recommended": ^1.0.2
@@ -11521,6 +11522,8 @@ __metadata:
11521
11522
peerDependenciesMeta:
11522
11523
"@dqbd/tiktoken":
11523
11524
optional: true
11525
+ "@getmetal/metal-sdk":
11526
+ optional: true
11524
11527
"@huggingface/inference":
11525
11528
optional: true
11526
11529
"@pinecone-database/pinecone":
You can’t perform that action at this time.
0 commit comments