@@ -62,53 +62,78 @@ export interface Evaluation {
62
62
}
63
63
64
64
export namespace Evaluation {
65
- /**
66
- * The initial messages to be included with your call to the LLM API.
67
- */
68
65
export interface AppendedMessage {
69
- /**
70
- * Example: "Hello, {{city}}!"
71
- */
72
- content : string | null ;
66
+ content : Array <
67
+ | AppendedMessage . TextContentBlockSchema
68
+ | AppendedMessage . ImageBase64ContentBlock
69
+ | AppendedMessage . ToolCallContentBlock
70
+ | AppendedMessage . ToolResultContentBlock
71
+ > ;
73
72
74
73
role : 'assistant' | 'system' | 'tool' | 'user' ;
75
-
76
- toolCallId : string | null ;
77
-
78
- toolCalls : Array < AppendedMessage . ToolCall > | null ;
79
74
}
80
75
81
76
export namespace AppendedMessage {
82
- export interface ToolCall {
83
- function : ToolCall . Function ;
77
+ export interface TextContentBlockSchema {
78
+ text : string ;
84
79
85
- /**
86
- * TOOL_CALL_1
87
- */
88
- toolCallId : string ;
80
+ type : 'TEXT' ;
81
+ }
82
+
83
+ export interface ImageBase64ContentBlock {
84
+ imageBase64 : string ;
85
+
86
+ mediaType : string ;
89
87
90
- /**
91
- * The type of the tool. Currently, only `function` is supported.
92
- */
93
- type : 'function' ;
88
+ type : 'IMAGE_BASE64' ;
94
89
}
95
90
96
- export namespace ToolCall {
97
- export interface Function {
91
+ export interface ToolCallContentBlock {
92
+ toolCall : ToolCallContentBlock . ToolCall ;
93
+
94
+ type : 'TOOL_CALL' ;
95
+ }
96
+
97
+ export namespace ToolCallContentBlock {
98
+ export interface ToolCall {
99
+ function : ToolCall . Function ;
100
+
98
101
/**
99
- * The arguments to call the function with, as generated by the model in JSON
100
- * format. Note that the model does not always generate valid JSON, and may
101
- * hallucinate parameters not defined by your function schema. Validate the
102
- * arguments in your code before calling your function.
102
+ * TOOL_CALL_1
103
103
*/
104
- arguments : string ;
104
+ toolCallId : string ;
105
105
106
106
/**
107
- * The name of the function to call .
107
+ * The type of the tool. Currently, only ` function` is supported .
108
108
*/
109
- name : string ;
109
+ type : 'function' ;
110
+ }
111
+
112
+ export namespace ToolCall {
113
+ export interface Function {
114
+ /**
115
+ * The arguments to call the function with, as generated by the model in JSON
116
+ * format. Note that the model does not always generate valid JSON, and may
117
+ * hallucinate parameters not defined by your function schema. Validate the
118
+ * arguments in your code before calling your function.
119
+ */
120
+ arguments : string ;
121
+
122
+ /**
123
+ * The name of the function to call.
124
+ */
125
+ name : string ;
126
+ }
110
127
}
111
128
}
129
+
130
+ export interface ToolResultContentBlock {
131
+ result : string ;
132
+
133
+ toolCallId : string ;
134
+
135
+ type : 'TOOL_RESULT' ;
136
+ }
112
137
}
113
138
}
114
139
@@ -133,53 +158,78 @@ export interface EvaluationCreateParams {
133
158
}
134
159
135
160
export namespace EvaluationCreateParams {
136
- /**
137
- * The initial messages to be included with your call to the LLM API.
138
- */
139
161
export interface AppendedMessage {
140
- /**
141
- * Example: "Hello, {{city}}!"
142
- */
143
- content : string | null ;
162
+ content : Array <
163
+ | AppendedMessage . TextContentBlockSchema
164
+ | AppendedMessage . ImageBase64ContentBlock
165
+ | AppendedMessage . ToolCallContentBlock
166
+ | AppendedMessage . ToolResultContentBlock
167
+ > ;
144
168
145
169
role : 'assistant' | 'system' | 'tool' | 'user' ;
146
-
147
- toolCallId : string | null ;
148
-
149
- toolCalls : Array < AppendedMessage . ToolCall > | null ;
150
170
}
151
171
152
172
export namespace AppendedMessage {
153
- export interface ToolCall {
154
- function : ToolCall . Function ;
173
+ export interface TextContentBlockSchema {
174
+ text : string ;
155
175
156
- /**
157
- * TOOL_CALL_1
158
- */
159
- toolCallId : string ;
176
+ type : 'TEXT' ;
177
+ }
178
+
179
+ export interface ImageBase64ContentBlock {
180
+ imageBase64 : string ;
160
181
161
- /**
162
- * The type of the tool. Currently, only `function` is supported.
163
- */
164
- type : 'function' ;
182
+ mediaType : string ;
183
+
184
+ type : 'IMAGE_BASE64' ;
165
185
}
166
186
167
- export namespace ToolCall {
168
- export interface Function {
187
+ export interface ToolCallContentBlock {
188
+ toolCall : ToolCallContentBlock . ToolCall ;
189
+
190
+ type : 'TOOL_CALL' ;
191
+ }
192
+
193
+ export namespace ToolCallContentBlock {
194
+ export interface ToolCall {
195
+ function : ToolCall . Function ;
196
+
169
197
/**
170
- * The arguments to call the function with, as generated by the model in JSON
171
- * format. Note that the model does not always generate valid JSON, and may
172
- * hallucinate parameters not defined by your function schema. Validate the
173
- * arguments in your code before calling your function.
198
+ * TOOL_CALL_1
174
199
*/
175
- arguments : string ;
200
+ toolCallId : string ;
176
201
177
202
/**
178
- * The name of the function to call .
203
+ * The type of the tool. Currently, only ` function` is supported .
179
204
*/
180
- name : string ;
205
+ type : 'function' ;
206
+ }
207
+
208
+ export namespace ToolCall {
209
+ export interface Function {
210
+ /**
211
+ * The arguments to call the function with, as generated by the model in JSON
212
+ * format. Note that the model does not always generate valid JSON, and may
213
+ * hallucinate parameters not defined by your function schema. Validate the
214
+ * arguments in your code before calling your function.
215
+ */
216
+ arguments : string ;
217
+
218
+ /**
219
+ * The name of the function to call.
220
+ */
221
+ name : string ;
222
+ }
181
223
}
182
224
}
225
+
226
+ export interface ToolResultContentBlock {
227
+ result : string ;
228
+
229
+ toolCallId : string ;
230
+
231
+ type : 'TOOL_RESULT' ;
232
+ }
183
233
}
184
234
}
185
235
@@ -198,52 +248,77 @@ export interface EvaluationUpdateParams {
198
248
}
199
249
200
250
export namespace EvaluationUpdateParams {
201
- /**
202
- * The initial messages to be included with your call to the LLM API.
203
- */
204
251
export interface AppendedMessage {
205
- /**
206
- * Example: "Hello, {{city}}!"
207
- */
208
- content : string | null ;
252
+ content : Array <
253
+ | AppendedMessage . TextContentBlockSchema
254
+ | AppendedMessage . ImageBase64ContentBlock
255
+ | AppendedMessage . ToolCallContentBlock
256
+ | AppendedMessage . ToolResultContentBlock
257
+ > ;
209
258
210
259
role : 'assistant' | 'system' | 'tool' | 'user' ;
211
-
212
- toolCallId : string | null ;
213
-
214
- toolCalls : Array < AppendedMessage . ToolCall > | null ;
215
260
}
216
261
217
262
export namespace AppendedMessage {
218
- export interface ToolCall {
219
- function : ToolCall . Function ;
263
+ export interface TextContentBlockSchema {
264
+ text : string ;
220
265
221
- /**
222
- * TOOL_CALL_1
223
- */
224
- toolCallId : string ;
266
+ type : 'TEXT' ;
267
+ }
268
+
269
+ export interface ImageBase64ContentBlock {
270
+ imageBase64 : string ;
225
271
226
- /**
227
- * The type of the tool. Currently, only `function` is supported.
228
- */
229
- type : 'function' ;
272
+ mediaType : string ;
273
+
274
+ type : 'IMAGE_BASE64' ;
230
275
}
231
276
232
- export namespace ToolCall {
233
- export interface Function {
277
+ export interface ToolCallContentBlock {
278
+ toolCall : ToolCallContentBlock . ToolCall ;
279
+
280
+ type : 'TOOL_CALL' ;
281
+ }
282
+
283
+ export namespace ToolCallContentBlock {
284
+ export interface ToolCall {
285
+ function : ToolCall . Function ;
286
+
234
287
/**
235
- * The arguments to call the function with, as generated by the model in JSON
236
- * format. Note that the model does not always generate valid JSON, and may
237
- * hallucinate parameters not defined by your function schema. Validate the
238
- * arguments in your code before calling your function.
288
+ * TOOL_CALL_1
239
289
*/
240
- arguments : string ;
290
+ toolCallId : string ;
241
291
242
292
/**
243
- * The name of the function to call .
293
+ * The type of the tool. Currently, only ` function` is supported .
244
294
*/
245
- name : string ;
295
+ type : 'function' ;
246
296
}
297
+
298
+ export namespace ToolCall {
299
+ export interface Function {
300
+ /**
301
+ * The arguments to call the function with, as generated by the model in JSON
302
+ * format. Note that the model does not always generate valid JSON, and may
303
+ * hallucinate parameters not defined by your function schema. Validate the
304
+ * arguments in your code before calling your function.
305
+ */
306
+ arguments : string ;
307
+
308
+ /**
309
+ * The name of the function to call.
310
+ */
311
+ name : string ;
312
+ }
313
+ }
314
+ }
315
+
316
+ export interface ToolResultContentBlock {
317
+ result : string ;
318
+
319
+ toolCallId : string ;
320
+
321
+ type : 'TOOL_RESULT' ;
247
322
}
248
323
}
249
324
}
0 commit comments