-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathmodels.ts
65 lines (55 loc) · 1.29 KB
/
models.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
export const enum RetrievalMode {
Hybrid = "rag",
Vectors = "vector",
Text = "keyword"
}
export type ChatAppRequestOverrides = {
retrieval_mode?: RetrievalMode;
top?: number;
temperature?: number;
score_threshold?: number;
};
export type ResponseMessage = {
content: string;
role: string;
};
export type JSONDataPoint = {
name: string;
description: string;
price: string;
category: string;
collection: string;
};
export type Thoughts = {
title: string;
description: any; // It can be any output from the api
props?: { [key: string]: string };
};
export type DataPoint = {
json: JSONDataPoint[];
};
export type ResponseContext = {
data_points: DataPoint;
thoughts: Thoughts[];
};
export type ChatAppResponseOrError = {
message: ResponseMessage;
delta: ResponseMessage;
context: ResponseContext;
session_state: string;
error?: string;
};
export type ChatAppResponse = {
message: ResponseMessage;
delta: ResponseMessage;
context: ResponseContext;
session_state: string | null;
};
export type ChatAppRequestContext = {
overrides?: ChatAppRequestOverrides;
};
export type ChatAppRequest = {
messages: ResponseMessage[];
context?: ChatAppRequestContext;
session_state: string | null;
};