-
Notifications
You must be signed in to change notification settings - Fork 3
/
tools.ts
43 lines (38 loc) · 872 Bytes
/
tools.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { PineconeHybridDatastore } from '@dexaai/dexter/datastore/pinecone';
import {
ChatModel,
EmbeddingModel,
SparseVectorModel,
} from '@dexaai/dexter/model';
export interface Chunk {
chunkId: string;
chunkTitle: string;
episodeTitle: string;
imgUrl: string;
published: string;
url: string;
transcript: string;
}
const embeddingModel = new EmbeddingModel({
params: { model: 'text-embedding-ada-002' },
});
const spladeModel = new SparseVectorModel({
params: {
model: 'naver/splade-cocondenser-ensembledistil',
concurrency: 30,
},
});
export const chunkDatastore = new PineconeHybridDatastore<Chunk>({
namespace: 'test12',
contentKey: 'transcript',
embeddingModel,
spladeModel,
});
export const chatModel = new ChatModel({
debug: true,
params: {
model: 'gpt-4',
temperature: 0.5,
max_tokens: 200,
},
});