@sap-ai-sdk/foundation-models 0.1.1-20240917012643.0 → 0.1.1-20240919013044.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{openai/openai-chat-client.d.ts → azure-openai/azure-openai-chat-client.d.ts} +9 -8
- package/dist/azure-openai/azure-openai-chat-client.d.ts.map +1 -0
- package/dist/{openai/openai-chat-client.js → azure-openai/azure-openai-chat-client.js} +6 -6
- package/dist/azure-openai/azure-openai-chat-client.js.map +1 -0
- package/dist/{openai/openai-response.d.ts → azure-openai/azure-openai-chat-completion-response.d.ts} +7 -7
- package/dist/azure-openai/azure-openai-chat-completion-response.d.ts.map +1 -0
- package/dist/{openai/openai-response.js → azure-openai/azure-openai-chat-completion-response.js} +5 -5
- package/dist/azure-openai/azure-openai-chat-completion-response.js.map +1 -0
- package/dist/{openai/openai-embedding-client.d.ts → azure-openai/azure-openai-embedding-client.d.ts} +9 -7
- package/dist/azure-openai/azure-openai-embedding-client.d.ts.map +1 -0
- package/dist/{openai/openai-embedding-client.js → azure-openai/azure-openai-embedding-client.js} +6 -5
- package/dist/azure-openai/azure-openai-embedding-client.js.map +1 -0
- package/dist/azure-openai/azure-openai-embedding-response.d.ts +21 -0
- package/dist/azure-openai/azure-openai-embedding-response.d.ts.map +1 -0
- package/dist/azure-openai/azure-openai-embedding-response.js +34 -0
- package/dist/azure-openai/azure-openai-embedding-response.js.map +1 -0
- package/dist/azure-openai/azure-openai-types-schema.d.ts +3087 -0
- package/dist/azure-openai/azure-openai-types-schema.d.ts.map +1 -0
- package/dist/azure-openai/azure-openai-types-schema.js +267 -0
- package/dist/azure-openai/azure-openai-types-schema.js.map +1 -0
- package/dist/{openai/openai-types.d.ts → azure-openai/azure-openai-types.d.ts} +71 -71
- package/dist/azure-openai/azure-openai-types.d.ts.map +1 -0
- package/dist/azure-openai/azure-openai-types.js +2 -0
- package/dist/azure-openai/azure-openai-types.js.map +1 -0
- package/dist/azure-openai/index.d.ts +7 -0
- package/dist/azure-openai/index.d.ts.map +1 -0
- package/dist/azure-openai/index.js +7 -0
- package/dist/azure-openai/index.js.map +1 -0
- package/dist/azure-openai/model-types.d.ts +10 -0
- package/dist/azure-openai/model-types.d.ts.map +1 -0
- package/dist/azure-openai/model-types.js +2 -0
- package/dist/azure-openai/model-types.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +1 -1
- package/dist/internal.js.map +1 -1
- package/package.json +17 -13
- package/dist/openai/index.d.ts +0 -5
- package/dist/openai/index.d.ts.map +0 -1
- package/dist/openai/index.js +0 -5
- package/dist/openai/index.js.map +0 -1
- package/dist/openai/openai-chat-client.d.ts.map +0 -1
- package/dist/openai/openai-chat-client.js.map +0 -1
- package/dist/openai/openai-embedding-client.d.ts.map +0 -1
- package/dist/openai/openai-embedding-client.js.map +0 -1
- package/dist/openai/openai-response.d.ts.map +0 -1
- package/dist/openai/openai-response.js.map +0 -1
- package/dist/openai/openai-types.d.ts.map +0 -1
- package/dist/openai/openai-types.js +0 -2
- package/dist/openai/openai-types.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"azure-openai-types-schema.d.ts","sourceRoot":"","sources":["../../src/azure-openai/azure-openai-types-schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;EAI7C,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2B3C,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;EAG5C,CAAC;AAEH;;GAEG;AACH,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AAC;AAEL;;GAEG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI9C,CAAC"}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
// Generated by ts-to-zod
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export const azureOpenAiChatSystemMessageSchema = z.object({
|
|
7
|
+
role: z.literal('system'),
|
|
8
|
+
name: z.string().optional(),
|
|
9
|
+
content: z.string()
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export const azureOpenAiChatUserMessageSchema = z.object({
|
|
15
|
+
role: z.literal('user'),
|
|
16
|
+
name: z.string().optional(),
|
|
17
|
+
content: z.union([
|
|
18
|
+
z.string(),
|
|
19
|
+
z.array(z.union([
|
|
20
|
+
z.object({
|
|
21
|
+
type: z.literal('text'),
|
|
22
|
+
text: z.string()
|
|
23
|
+
}),
|
|
24
|
+
z.object({
|
|
25
|
+
type: z.literal('image_url'),
|
|
26
|
+
image_url: z.union([
|
|
27
|
+
z.string(),
|
|
28
|
+
z.object({
|
|
29
|
+
url: z.string(),
|
|
30
|
+
detail: z
|
|
31
|
+
.union([z.literal('auto'), z.literal('low'), z.literal('high')])
|
|
32
|
+
.optional()
|
|
33
|
+
.default('auto')
|
|
34
|
+
})
|
|
35
|
+
])
|
|
36
|
+
})
|
|
37
|
+
]))
|
|
38
|
+
])
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
export const azureOpenAiChatFunctionCallSchema = z.object({
|
|
44
|
+
name: z.string(),
|
|
45
|
+
arguments: z.string()
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
export const azureOpenAiChatToolCallSchema = z.object({
|
|
51
|
+
id: z.string(),
|
|
52
|
+
type: z.literal('function'),
|
|
53
|
+
function: azureOpenAiChatFunctionCallSchema
|
|
54
|
+
});
|
|
55
|
+
/**
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
export const azureOpenAiChatToolMessageSchema = z.object({
|
|
59
|
+
role: z.literal('tool'),
|
|
60
|
+
content: z.string(),
|
|
61
|
+
tool_call_id: z.string()
|
|
62
|
+
});
|
|
63
|
+
/**
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
export const azureOpenAiChatFunctionMessageSchema = z.object({
|
|
67
|
+
role: z.literal('function'),
|
|
68
|
+
content: z.string().nullable(),
|
|
69
|
+
name: z.string()
|
|
70
|
+
});
|
|
71
|
+
/**
|
|
72
|
+
* @internal
|
|
73
|
+
*/
|
|
74
|
+
export const azureOpenAiChatAssistantMessageSchema = z.object({
|
|
75
|
+
role: z.literal('assistant'),
|
|
76
|
+
name: z.string().optional(),
|
|
77
|
+
content: z.string().optional(),
|
|
78
|
+
function_call: azureOpenAiChatFunctionCallSchema.optional(),
|
|
79
|
+
tool_calls: z.array(azureOpenAiChatToolCallSchema).optional()
|
|
80
|
+
});
|
|
81
|
+
/**
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
84
|
+
export const azureOpenAiChatCompletionFunctionSchema = z.object({
|
|
85
|
+
name: z.string(),
|
|
86
|
+
description: z.string().optional(),
|
|
87
|
+
parameters: z.record(z.unknown())
|
|
88
|
+
});
|
|
89
|
+
/**
|
|
90
|
+
* @internal
|
|
91
|
+
*/
|
|
92
|
+
export const azureOpenAiChatCompletionToolSchema = z.object({
|
|
93
|
+
type: z.literal('function'),
|
|
94
|
+
function: azureOpenAiChatCompletionFunctionSchema
|
|
95
|
+
});
|
|
96
|
+
/**
|
|
97
|
+
* @internal
|
|
98
|
+
*/
|
|
99
|
+
export const azureOpenAiCompletionParametersSchema = z.object({
|
|
100
|
+
max_tokens: z.number().optional(),
|
|
101
|
+
temperature: z.number().optional(),
|
|
102
|
+
top_p: z.number().optional(),
|
|
103
|
+
logit_bias: z.record(z.unknown()).optional(),
|
|
104
|
+
user: z.string().optional(),
|
|
105
|
+
n: z.number().optional(),
|
|
106
|
+
stop: z.union([z.string(), z.array(z.string())]).optional(),
|
|
107
|
+
presence_penalty: z.number().optional(),
|
|
108
|
+
frequency_penalty: z.number().optional()
|
|
109
|
+
});
|
|
110
|
+
/**
|
|
111
|
+
* @internal
|
|
112
|
+
*/
|
|
113
|
+
export const azureOpenAiChatMessageSchema = z.union([
|
|
114
|
+
azureOpenAiChatSystemMessageSchema,
|
|
115
|
+
azureOpenAiChatUserMessageSchema,
|
|
116
|
+
azureOpenAiChatAssistantMessageSchema,
|
|
117
|
+
azureOpenAiChatToolMessageSchema,
|
|
118
|
+
azureOpenAiChatFunctionMessageSchema
|
|
119
|
+
]);
|
|
120
|
+
/**
|
|
121
|
+
* @internal
|
|
122
|
+
*/
|
|
123
|
+
export const azureOpenAiEmbeddingParametersSchema = z.object({
|
|
124
|
+
input: z.union([z.array(z.string()), z.string()]),
|
|
125
|
+
user: z.string().optional()
|
|
126
|
+
});
|
|
127
|
+
/**
|
|
128
|
+
* @internal
|
|
129
|
+
*/
|
|
130
|
+
export const azureOpenAiUsageSchema = z.object({
|
|
131
|
+
completion_tokens: z.number(),
|
|
132
|
+
prompt_tokens: z.number(),
|
|
133
|
+
total_tokens: z.number()
|
|
134
|
+
});
|
|
135
|
+
/**
|
|
136
|
+
* @internal
|
|
137
|
+
*/
|
|
138
|
+
export const azureOpenAiErrorBaseSchema = z.object({
|
|
139
|
+
code: z.string().optional(),
|
|
140
|
+
message: z.string().optional()
|
|
141
|
+
});
|
|
142
|
+
/**
|
|
143
|
+
* @internal
|
|
144
|
+
*/
|
|
145
|
+
export const azureOpenAiContentFilterResultBaseSchema = z.object({
|
|
146
|
+
filtered: z.boolean()
|
|
147
|
+
});
|
|
148
|
+
/**
|
|
149
|
+
* @internal
|
|
150
|
+
*/
|
|
151
|
+
export const azureOpenAiContentFilterDetectedResultSchema = azureOpenAiContentFilterResultBaseSchema.extend({
|
|
152
|
+
detected: z.boolean()
|
|
153
|
+
});
|
|
154
|
+
/**
|
|
155
|
+
* @internal
|
|
156
|
+
*/
|
|
157
|
+
export const azureOpenAiContentFilterSeverityResultSchema = azureOpenAiContentFilterResultBaseSchema.extend({
|
|
158
|
+
severity: z.union([
|
|
159
|
+
z.literal('safe'),
|
|
160
|
+
z.literal('low'),
|
|
161
|
+
z.literal('medium'),
|
|
162
|
+
z.literal('high')
|
|
163
|
+
])
|
|
164
|
+
});
|
|
165
|
+
/**
|
|
166
|
+
* @internal
|
|
167
|
+
*/
|
|
168
|
+
export const azureOpenAiEmbeddingOutputSchema = z.object({
|
|
169
|
+
object: z.literal('list'),
|
|
170
|
+
model: z.string(),
|
|
171
|
+
data: z.tuple([
|
|
172
|
+
z.object({
|
|
173
|
+
object: z.literal('embedding'),
|
|
174
|
+
embedding: z.array(z.number()),
|
|
175
|
+
index: z.number()
|
|
176
|
+
})
|
|
177
|
+
]),
|
|
178
|
+
usage: z.object({
|
|
179
|
+
prompt_tokens: z.number(),
|
|
180
|
+
total_tokens: z.number()
|
|
181
|
+
})
|
|
182
|
+
});
|
|
183
|
+
/**
|
|
184
|
+
* @internal
|
|
185
|
+
*/
|
|
186
|
+
export const azureOpenAiChatCompletionParametersSchema = azureOpenAiCompletionParametersSchema.extend({
|
|
187
|
+
messages: z.array(azureOpenAiChatMessageSchema),
|
|
188
|
+
response_format: z
|
|
189
|
+
.object({
|
|
190
|
+
type: z
|
|
191
|
+
.union([z.literal('text'), z.literal('json_object')])
|
|
192
|
+
.default('text')
|
|
193
|
+
})
|
|
194
|
+
.optional(),
|
|
195
|
+
seed: z.number().optional(),
|
|
196
|
+
functions: z.array(azureOpenAiChatCompletionFunctionSchema).optional(),
|
|
197
|
+
tools: z.array(azureOpenAiChatCompletionToolSchema).optional(),
|
|
198
|
+
tool_choice: z
|
|
199
|
+
.union([
|
|
200
|
+
z.literal('none'),
|
|
201
|
+
z.literal('auto'),
|
|
202
|
+
z.object({
|
|
203
|
+
type: z.literal('function'),
|
|
204
|
+
function: z.object({
|
|
205
|
+
name: z.string()
|
|
206
|
+
})
|
|
207
|
+
})
|
|
208
|
+
])
|
|
209
|
+
.optional()
|
|
210
|
+
});
|
|
211
|
+
/**
|
|
212
|
+
* @internal
|
|
213
|
+
*/
|
|
214
|
+
export const azureOpenAiContentFilterResultsBaseSchema = z.object({
|
|
215
|
+
sexual: azureOpenAiContentFilterSeverityResultSchema.optional(),
|
|
216
|
+
violence: azureOpenAiContentFilterSeverityResultSchema.optional(),
|
|
217
|
+
hate: azureOpenAiContentFilterSeverityResultSchema.optional(),
|
|
218
|
+
self_harm: azureOpenAiContentFilterSeverityResultSchema.optional(),
|
|
219
|
+
profanity: azureOpenAiContentFilterDetectedResultSchema.optional(),
|
|
220
|
+
error: azureOpenAiErrorBaseSchema.optional()
|
|
221
|
+
});
|
|
222
|
+
/**
|
|
223
|
+
* @internal
|
|
224
|
+
*/
|
|
225
|
+
export const azureOpenAiContentFilterPromptResultsSchema = azureOpenAiContentFilterResultsBaseSchema.extend({
|
|
226
|
+
jailbreak: azureOpenAiContentFilterDetectedResultSchema.optional()
|
|
227
|
+
});
|
|
228
|
+
/**
|
|
229
|
+
* @internal
|
|
230
|
+
*/
|
|
231
|
+
export const azureOpenAiPromptFilterResultSchema = z.object({
|
|
232
|
+
prompt_index: z.number().optional(),
|
|
233
|
+
content_filter_results: azureOpenAiContentFilterPromptResultsSchema.optional()
|
|
234
|
+
});
|
|
235
|
+
/**
|
|
236
|
+
* @internal
|
|
237
|
+
*/
|
|
238
|
+
export const azureOpenAiCompletionOutputSchema = z.object({
|
|
239
|
+
created: z.number(),
|
|
240
|
+
id: z.string(),
|
|
241
|
+
model: z.string(),
|
|
242
|
+
object: z.union([z.literal('chat.completion'), z.literal('text_completion')]),
|
|
243
|
+
usage: azureOpenAiUsageSchema,
|
|
244
|
+
prompt_filter_results: z.array(azureOpenAiPromptFilterResultSchema).optional()
|
|
245
|
+
});
|
|
246
|
+
/**
|
|
247
|
+
* @internal
|
|
248
|
+
*/
|
|
249
|
+
export const azureOpenAiCompletionChoiceSchema = z.object({
|
|
250
|
+
finish_reason: z.string().optional(),
|
|
251
|
+
index: z.number(),
|
|
252
|
+
content_filter_results: azureOpenAiContentFilterPromptResultsSchema.optional()
|
|
253
|
+
});
|
|
254
|
+
/**
|
|
255
|
+
* @internal
|
|
256
|
+
*/
|
|
257
|
+
export const azureOpenAiChatCompletionChoiceSchema = azureOpenAiCompletionChoiceSchema.extend({
|
|
258
|
+
message: azureOpenAiChatAssistantMessageSchema
|
|
259
|
+
});
|
|
260
|
+
/**
|
|
261
|
+
* @internal
|
|
262
|
+
*/
|
|
263
|
+
export const azureOpenAiChatCompletionOutputSchema = azureOpenAiCompletionOutputSchema.extend({
|
|
264
|
+
choices: z.array(azureOpenAiChatCompletionChoiceSchema),
|
|
265
|
+
system_fingerprint: z.string().nullable()
|
|
266
|
+
});
|
|
267
|
+
//# sourceMappingURL=azure-openai-types-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"azure-openai-types-schema.js","sourceRoot":"","sources":["../../src/azure-openai/azure-openai-types-schema.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CAAC;IACzD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IACzB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IACvD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IACvB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC;QACf,CAAC,CAAC,MAAM,EAAE;QACV,CAAC,CAAC,KAAK,CACL,CAAC,CAAC,KAAK,CAAC;YACN,CAAC,CAAC,MAAM,CAAC;gBACP,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;gBACvB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;aACjB,CAAC;YACF,CAAC,CAAC,MAAM,CAAC;gBACP,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAA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BAAsB,EAAE,2CAA2C,CAAC,QAAQ,EAAE;CAC/E,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAChD,iCAAiC,CAAC,MAAM,CAAC;IACvC,OAAO,EAAE,qCAAqC;CAC/C,CAAC,CAAC;AAEL;;GAEG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAChD,iCAAiC,CAAC,MAAM,CAAC;IACvC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,qCAAqC,CAAC;IACvD,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* OpenAI system message.
|
|
2
|
+
* Azure OpenAI system message.
|
|
3
3
|
*/
|
|
4
|
-
export interface
|
|
4
|
+
export interface AzureOpenAiChatSystemMessage {
|
|
5
5
|
/**
|
|
6
6
|
* The role of the messages author,.
|
|
7
7
|
*/
|
|
@@ -16,9 +16,9 @@ export interface OpenAiChatSystemMessage {
|
|
|
16
16
|
content: string;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
* OpenAI user message.
|
|
19
|
+
* Azure OpenAI user message.
|
|
20
20
|
*/
|
|
21
|
-
export interface
|
|
21
|
+
export interface AzureOpenAiChatUserMessage {
|
|
22
22
|
/**
|
|
23
23
|
* The role of the messages author,.
|
|
24
24
|
*/
|
|
@@ -58,9 +58,9 @@ export interface OpenAiChatUserMessage {
|
|
|
58
58
|
})[];
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
-
* OpenAI assistant message.
|
|
61
|
+
* Azure OpenAI assistant message.
|
|
62
62
|
*/
|
|
63
|
-
export interface
|
|
63
|
+
export interface AzureOpenAiChatAssistantMessage {
|
|
64
64
|
/**
|
|
65
65
|
* The role of the messages author,.
|
|
66
66
|
*/
|
|
@@ -77,16 +77,16 @@ export interface OpenAiChatAssistantMessage {
|
|
|
77
77
|
* Function which is called.
|
|
78
78
|
* @deprecated In favor of `tool_calls`.
|
|
79
79
|
*/
|
|
80
|
-
function_call?:
|
|
80
|
+
function_call?: AzureOpenAiChatFunctionCall;
|
|
81
81
|
/**
|
|
82
82
|
* The tool calls generated by the model, such as function calls.
|
|
83
83
|
*/
|
|
84
|
-
tool_calls?:
|
|
84
|
+
tool_calls?: AzureOpenAiChatToolCall[];
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
87
|
-
* OpenAI tool message.
|
|
87
|
+
* Azure OpenAI tool message.
|
|
88
88
|
*/
|
|
89
|
-
export interface
|
|
89
|
+
export interface AzureOpenAiChatToolMessage {
|
|
90
90
|
/**
|
|
91
91
|
* The role of the messages author,.
|
|
92
92
|
*/
|
|
@@ -101,9 +101,9 @@ export interface OpenAiChatToolMessage {
|
|
|
101
101
|
tool_call_id: string;
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
104
|
-
* OpenAI function message.
|
|
104
|
+
* Azure OpenAI function message.
|
|
105
105
|
*/
|
|
106
|
-
export interface
|
|
106
|
+
export interface AzureOpenAiChatFunctionMessage {
|
|
107
107
|
/**
|
|
108
108
|
* The role of the messages author,.
|
|
109
109
|
*/
|
|
@@ -118,13 +118,13 @@ export interface OpenAiChatFunctionMessage {
|
|
|
118
118
|
name: string;
|
|
119
119
|
}
|
|
120
120
|
/**
|
|
121
|
-
* OpenAI chat message types.
|
|
121
|
+
* Azure OpenAI chat message types.
|
|
122
122
|
*/
|
|
123
|
-
export type
|
|
123
|
+
export type AzureOpenAiChatMessage = AzureOpenAiChatSystemMessage | AzureOpenAiChatUserMessage | AzureOpenAiChatAssistantMessage | AzureOpenAiChatToolMessage | AzureOpenAiChatFunctionMessage;
|
|
124
124
|
/**
|
|
125
|
-
* OpenAI function signature.
|
|
125
|
+
* Azure OpenAI function signature.
|
|
126
126
|
*/
|
|
127
|
-
export interface
|
|
127
|
+
export interface AzureOpenAiChatCompletionFunction {
|
|
128
128
|
/**
|
|
129
129
|
* Name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
|
|
130
130
|
*/
|
|
@@ -137,14 +137,14 @@ export interface OpenAiChatCompletionFunction {
|
|
|
137
137
|
* JSON Schema for the function input parameters.
|
|
138
138
|
*
|
|
139
139
|
* **Note**: As mentioned in {@link https://community.openai.com/t/whitch-json-schema-version-should-function-calling-use/283535/4}, it follows JSON Schema 7 (2020-12).
|
|
140
|
-
* Not all JSON Schema parameters in the specification are supported by OpenAI.
|
|
140
|
+
* Not all JSON Schema parameters in the specification are supported by Azure OpenAI.
|
|
141
141
|
*/
|
|
142
142
|
parameters: Record<string, unknown>;
|
|
143
143
|
}
|
|
144
144
|
/**
|
|
145
|
-
* OpenAI tool signature.
|
|
145
|
+
* Azure OpenAI tool signature.
|
|
146
146
|
*/
|
|
147
|
-
export interface
|
|
147
|
+
export interface AzureOpenAiChatCompletionTool {
|
|
148
148
|
/**
|
|
149
149
|
* The type of the tool.
|
|
150
150
|
*/
|
|
@@ -152,12 +152,12 @@ export interface OpenAiChatCompletionTool {
|
|
|
152
152
|
/**
|
|
153
153
|
* Function signature.
|
|
154
154
|
*/
|
|
155
|
-
function:
|
|
155
|
+
function: AzureOpenAiChatCompletionFunction;
|
|
156
156
|
}
|
|
157
157
|
/**
|
|
158
|
-
* OpenAI function call by AI.
|
|
158
|
+
* Azure OpenAI function call by AI.
|
|
159
159
|
*/
|
|
160
|
-
export interface
|
|
160
|
+
export interface AzureOpenAiChatFunctionCall {
|
|
161
161
|
/**
|
|
162
162
|
* Name of the function call.
|
|
163
163
|
*/
|
|
@@ -168,9 +168,9 @@ export interface OpenAiChatFunctionCall {
|
|
|
168
168
|
arguments: string;
|
|
169
169
|
}
|
|
170
170
|
/**
|
|
171
|
-
* OpenAI tool call by AI.
|
|
171
|
+
* Azure OpenAI tool call by AI.
|
|
172
172
|
*/
|
|
173
|
-
export interface
|
|
173
|
+
export interface AzureOpenAiChatToolCall {
|
|
174
174
|
/**
|
|
175
175
|
* The ID of the tool call.
|
|
176
176
|
*/
|
|
@@ -182,12 +182,12 @@ export interface OpenAiChatToolCall {
|
|
|
182
182
|
/**
|
|
183
183
|
* The function that the model called.
|
|
184
184
|
*/
|
|
185
|
-
function:
|
|
185
|
+
function: AzureOpenAiChatFunctionCall;
|
|
186
186
|
}
|
|
187
187
|
/**
|
|
188
|
-
* OpenAI completion input parameters.
|
|
188
|
+
* Azure OpenAI completion input parameters.
|
|
189
189
|
*/
|
|
190
|
-
export interface
|
|
190
|
+
export interface AzureOpenAiCompletionParameters {
|
|
191
191
|
/**
|
|
192
192
|
* The maximum number of [tokens](/tokenizer) that can be generated in the completion. The token count of your prompt plus max_tokens can't exceed the model's context length. Most models have a context length of 2048 tokens (except for the newest models, which support 4096).
|
|
193
193
|
*/
|
|
@@ -226,13 +226,13 @@ export interface OpenAiCompletionParameters {
|
|
|
226
226
|
frequency_penalty?: number;
|
|
227
227
|
}
|
|
228
228
|
/**
|
|
229
|
-
* OpenAI chat completion input parameters.
|
|
229
|
+
* Azure OpenAI chat completion input parameters.
|
|
230
230
|
*/
|
|
231
|
-
export interface
|
|
231
|
+
export interface AzureOpenAiChatCompletionParameters extends AzureOpenAiCompletionParameters {
|
|
232
232
|
/**
|
|
233
233
|
* An array of system, user & assistant messages for chat completion.
|
|
234
234
|
*/
|
|
235
|
-
messages:
|
|
235
|
+
messages: AzureOpenAiChatMessage[];
|
|
236
236
|
/**
|
|
237
237
|
* An object specifying the format that the model must output. Setting to { "type": "json_object" } enables JSON mode, which guarantees the message the model generates is valid JSON.
|
|
238
238
|
*
|
|
@@ -253,11 +253,11 @@ export interface OpenAiChatCompletionParameters extends OpenAiCompletionParamete
|
|
|
253
253
|
* Array of function signatures to be called.
|
|
254
254
|
* @deprecated Use `tools` instead.
|
|
255
255
|
*/
|
|
256
|
-
functions?:
|
|
256
|
+
functions?: AzureOpenAiChatCompletionFunction[];
|
|
257
257
|
/**
|
|
258
258
|
* A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for.
|
|
259
259
|
*/
|
|
260
|
-
tools?:
|
|
260
|
+
tools?: AzureOpenAiChatCompletionTool[];
|
|
261
261
|
/**
|
|
262
262
|
* Controls which (if any) function is called by the model.
|
|
263
263
|
*
|
|
@@ -282,9 +282,9 @@ export interface OpenAiChatCompletionParameters extends OpenAiCompletionParamete
|
|
|
282
282
|
};
|
|
283
283
|
}
|
|
284
284
|
/**
|
|
285
|
-
* OpenAI embedding input parameters.
|
|
285
|
+
* Azure OpenAI embedding input parameters.
|
|
286
286
|
*/
|
|
287
|
-
export interface
|
|
287
|
+
export interface AzureOpenAiEmbeddingParameters {
|
|
288
288
|
/**
|
|
289
289
|
* Input text to get embeddings for, encoded as a string. The number of input tokens varies depending on what model you are using. Unless you're embedding code, we suggest replacing newlines (\n) in your input with a single space, as we have observed inferior results when newlines are present.
|
|
290
290
|
*/
|
|
@@ -297,7 +297,7 @@ export interface OpenAiEmbeddingParameters {
|
|
|
297
297
|
/**
|
|
298
298
|
* Usage statistics for the completion request.
|
|
299
299
|
*/
|
|
300
|
-
export interface
|
|
300
|
+
export interface AzureOpenAiUsage {
|
|
301
301
|
/**
|
|
302
302
|
* Tokens consumed for output text completion.
|
|
303
303
|
*/
|
|
@@ -312,9 +312,9 @@ export interface OpenAiUsage {
|
|
|
312
312
|
total_tokens: number;
|
|
313
313
|
}
|
|
314
314
|
/**
|
|
315
|
-
* OpenAI completion output .
|
|
315
|
+
* Azure OpenAI completion output .
|
|
316
316
|
*/
|
|
317
|
-
export interface
|
|
317
|
+
export interface AzureOpenAiCompletionOutput {
|
|
318
318
|
/**
|
|
319
319
|
*
|
|
320
320
|
*/
|
|
@@ -334,30 +334,30 @@ export interface OpenAiCompletionOutput {
|
|
|
334
334
|
/**
|
|
335
335
|
* Token usage.
|
|
336
336
|
*/
|
|
337
|
-
usage:
|
|
337
|
+
usage: AzureOpenAiUsage;
|
|
338
338
|
/**
|
|
339
339
|
* Content filtering results for zero or more prompts in the request.
|
|
340
340
|
*/
|
|
341
|
-
prompt_filter_results?:
|
|
341
|
+
prompt_filter_results?: AzureOpenAiPromptFilterResult[];
|
|
342
342
|
}
|
|
343
343
|
/**
|
|
344
|
-
* OpenAI chat completion output.
|
|
344
|
+
* Azure OpenAI chat completion output.
|
|
345
345
|
*/
|
|
346
|
-
export interface
|
|
346
|
+
export interface AzureOpenAiChatCompletionOutput extends AzureOpenAiCompletionOutput {
|
|
347
347
|
/**
|
|
348
348
|
* Array of result candidates.
|
|
349
349
|
*/
|
|
350
|
-
choices:
|
|
350
|
+
choices: AzureOpenAiChatCompletionChoice[];
|
|
351
351
|
/**
|
|
352
352
|
* This fingerprint represents the backend configuration that the model runs with.
|
|
353
353
|
* Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.
|
|
354
354
|
*/
|
|
355
|
-
system_fingerprint: string;
|
|
355
|
+
system_fingerprint: string | null;
|
|
356
356
|
}
|
|
357
357
|
/**
|
|
358
358
|
* Content filtering results for a single prompt in the request.
|
|
359
359
|
*/
|
|
360
|
-
export interface
|
|
360
|
+
export interface AzureOpenAiPromptFilterResult {
|
|
361
361
|
/**
|
|
362
362
|
* Index of the prompt in the request.
|
|
363
363
|
*/
|
|
@@ -365,12 +365,12 @@ export interface OpenAiPromptFilterResult {
|
|
|
365
365
|
/**
|
|
366
366
|
* Information about the content filtering category, if it has been detected, as well as the severity level and if it has been filtered or not.
|
|
367
367
|
*/
|
|
368
|
-
content_filter_results?:
|
|
368
|
+
content_filter_results?: AzureOpenAiContentFilterPromptResults;
|
|
369
369
|
}
|
|
370
370
|
/**
|
|
371
|
-
* OpenAI completion choice.
|
|
371
|
+
* Azure OpenAI completion choice.
|
|
372
372
|
*/
|
|
373
|
-
export interface
|
|
373
|
+
export interface AzureOpenAiCompletionChoice {
|
|
374
374
|
/**
|
|
375
375
|
* Reason for finish.
|
|
376
376
|
*/
|
|
@@ -382,77 +382,77 @@ export interface OpenAiCompletionChoice {
|
|
|
382
382
|
/**
|
|
383
383
|
* Information about the content filtering category, if it has been detected, as well as the severity level and if it has been filtered or not.
|
|
384
384
|
*/
|
|
385
|
-
content_filter_results?:
|
|
385
|
+
content_filter_results?: AzureOpenAiContentFilterPromptResults;
|
|
386
386
|
}
|
|
387
387
|
/**
|
|
388
|
-
* OpenAI chat completion choice.
|
|
388
|
+
* Azure OpenAI chat completion choice.
|
|
389
389
|
*/
|
|
390
|
-
export interface
|
|
390
|
+
export interface AzureOpenAiChatCompletionChoice extends AzureOpenAiCompletionChoice {
|
|
391
391
|
/**
|
|
392
392
|
* Completion chat message.
|
|
393
393
|
*/
|
|
394
|
-
message:
|
|
394
|
+
message: AzureOpenAiChatAssistantMessage;
|
|
395
395
|
}
|
|
396
396
|
/**
|
|
397
397
|
* Information about the content filtering results.
|
|
398
398
|
*/
|
|
399
|
-
export interface
|
|
399
|
+
export interface AzureOpenAiContentFilterResultsBase {
|
|
400
400
|
/**
|
|
401
401
|
* Sexual content filter result.
|
|
402
402
|
*/
|
|
403
|
-
sexual?:
|
|
403
|
+
sexual?: AzureOpenAiContentFilterSeverityResult;
|
|
404
404
|
/**
|
|
405
405
|
* Violent content filter result.
|
|
406
406
|
*/
|
|
407
|
-
violence?:
|
|
407
|
+
violence?: AzureOpenAiContentFilterSeverityResult;
|
|
408
408
|
/**
|
|
409
409
|
* Hate speech content filter result.
|
|
410
410
|
*/
|
|
411
|
-
hate?:
|
|
411
|
+
hate?: AzureOpenAiContentFilterSeverityResult;
|
|
412
412
|
/**
|
|
413
413
|
* Intolerant content filter result.
|
|
414
414
|
*/
|
|
415
|
-
|
|
415
|
+
self_harm?: AzureOpenAiContentFilterSeverityResult;
|
|
416
416
|
/**
|
|
417
417
|
* Profanity content filter result.
|
|
418
418
|
*/
|
|
419
|
-
profanity?:
|
|
419
|
+
profanity?: AzureOpenAiContentFilterDetectedResult;
|
|
420
420
|
/**
|
|
421
421
|
* Error.
|
|
422
422
|
*/
|
|
423
|
-
error?:
|
|
423
|
+
error?: AzureOpenAiErrorBase;
|
|
424
424
|
}
|
|
425
425
|
/**
|
|
426
426
|
* Content filtering results for a prompt in the request.
|
|
427
427
|
*/
|
|
428
|
-
export interface
|
|
428
|
+
export interface AzureOpenAiContentFilterPromptResults extends AzureOpenAiContentFilterResultsBase {
|
|
429
429
|
/**
|
|
430
430
|
*
|
|
431
431
|
*/
|
|
432
|
-
jailbreak?:
|
|
432
|
+
jailbreak?: AzureOpenAiContentFilterDetectedResult;
|
|
433
433
|
}
|
|
434
434
|
/**
|
|
435
|
-
* OpenAI content filter result.
|
|
435
|
+
* Azure OpenAI content filter result.
|
|
436
436
|
*/
|
|
437
|
-
export interface
|
|
437
|
+
export interface AzureOpenAiContentFilterResultBase {
|
|
438
438
|
/**
|
|
439
439
|
* Whether the content was filtered.
|
|
440
440
|
*/
|
|
441
441
|
filtered: boolean;
|
|
442
442
|
}
|
|
443
443
|
/**
|
|
444
|
-
* OpenAI content filter detected result.
|
|
444
|
+
* Azure OpenAI content filter detected result.
|
|
445
445
|
*/
|
|
446
|
-
export interface
|
|
446
|
+
export interface AzureOpenAiContentFilterDetectedResult extends AzureOpenAiContentFilterResultBase {
|
|
447
447
|
/**
|
|
448
448
|
* Whether the content was detected.
|
|
449
449
|
*/
|
|
450
450
|
detected: boolean;
|
|
451
451
|
}
|
|
452
452
|
/**
|
|
453
|
-
* OpenAI error.
|
|
453
|
+
* Azure OpenAI error.
|
|
454
454
|
*/
|
|
455
|
-
export interface
|
|
455
|
+
export interface AzureOpenAiErrorBase {
|
|
456
456
|
/**
|
|
457
457
|
* Error code.
|
|
458
458
|
*/
|
|
@@ -465,16 +465,16 @@ export interface OpenAiErrorBase {
|
|
|
465
465
|
/**
|
|
466
466
|
* Information about the content filtering results.
|
|
467
467
|
*/
|
|
468
|
-
export interface
|
|
468
|
+
export interface AzureOpenAiContentFilterSeverityResult extends AzureOpenAiContentFilterResultBase {
|
|
469
469
|
/**
|
|
470
470
|
* Severity of the content.
|
|
471
471
|
*/
|
|
472
472
|
severity: 'safe' | 'low' | 'medium' | 'high';
|
|
473
473
|
}
|
|
474
474
|
/**
|
|
475
|
-
* OpenAI embedding output.
|
|
475
|
+
* Azure OpenAI embedding output.
|
|
476
476
|
*/
|
|
477
|
-
export interface
|
|
477
|
+
export interface AzureOpenAiEmbeddingOutput {
|
|
478
478
|
/**
|
|
479
479
|
* List object.
|
|
480
480
|
*/
|
|
@@ -493,7 +493,7 @@ export interface OpenAiEmbeddingOutput {
|
|
|
493
493
|
*/
|
|
494
494
|
object: 'embedding';
|
|
495
495
|
/**
|
|
496
|
-
* Array of size `1536` (OpenAI's embedding size) containing embedding vector.
|
|
496
|
+
* Array of size `1536` (Azure OpenAI's embedding size) containing embedding vector.
|
|
497
497
|
*/
|
|
498
498
|
embedding: number[];
|
|
499
499
|
/**
|
|
@@ -516,4 +516,4 @@ export interface OpenAiEmbeddingOutput {
|
|
|
516
516
|
total_tokens: number;
|
|
517
517
|
};
|
|
518
518
|
}
|
|
519
|
-
//# sourceMappingURL=openai-types.d.ts.map
|
|
519
|
+
//# sourceMappingURL=azure-openai-types.d.ts.map
|