forked from Azure-Samples/azure-search-openai-demo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodels.ts
123 lines (108 loc) · 2.79 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
export const enum RetrievalMode {
Hybrid = "hybrid",
Vectors = "vectors",
Text = "text"
}
export const enum GPT4VInput {
TextAndImages = "textAndImages",
Images = "images",
Texts = "texts"
}
export const enum VectorFieldOptions {
Embedding = "embedding",
ImageEmbedding = "imageEmbedding",
Both = "both"
}
export type ChatAppRequestOverrides = {
retrieval_mode?: RetrievalMode;
semantic_ranker?: boolean;
semantic_captions?: boolean;
include_category?: string;
exclude_category?: string;
seed?: number;
top?: number;
temperature?: number;
minimum_search_score?: number;
minimum_reranker_score?: number;
prompt_template?: string;
prompt_template_prefix?: string;
prompt_template_suffix?: string;
suggest_followup_questions?: boolean;
use_oid_security_filter?: boolean;
use_groups_security_filter?: boolean;
use_gpt4v?: boolean;
gpt4v_input?: GPT4VInput;
vector_fields: VectorFieldOptions[];
language: string;
};
export type ResponseMessage = {
content: string;
role: string;
};
export type Thoughts = {
title: string;
description: any; // It can be any output from the api
props?: { [key: string]: string };
};
export type ResponseContext = {
data_points: string[];
followup_questions: string[] | null;
thoughts: Thoughts[];
};
export type ChatAppResponseOrError = {
message: ResponseMessage;
delta: ResponseMessage;
context: ResponseContext;
session_state: any;
error?: string;
};
export type ChatAppResponse = {
message: ResponseMessage;
delta: ResponseMessage;
context: ResponseContext;
session_state: any;
};
export type ChatAppRequestContext = {
overrides?: ChatAppRequestOverrides;
};
export type ChatAppRequest = {
messages: ResponseMessage[];
context?: ChatAppRequestContext;
session_state: any;
};
export type Config = {
showGPT4VOptions: boolean;
showSemanticRankerOption: boolean;
showVectorOption: boolean;
showUserUpload: boolean;
showLanguagePicker: boolean;
showSpeechInput: boolean;
showSpeechOutputBrowser: boolean;
showSpeechOutputAzure: boolean;
showChatHistoryBrowser: boolean;
showChatHistoryCosmos: boolean;
};
export type SimpleAPIResponse = {
message?: string;
};
export interface SpeechConfig {
speechUrls: (string | null)[];
setSpeechUrls: (urls: (string | null)[]) => void;
audio: HTMLAudioElement;
isPlaying: boolean;
setIsPlaying: (isPlaying: boolean) => void;
}
export type HistoryListApiResponse = {
sessions: {
id: string;
entra_oid: string;
title: string;
timestamp: number;
}[];
continuation_token?: string;
};
export type HistoryApiResponse = {
id: string;
entra_oid: string;
answers: any;
};