Skip to content

Commit 51f7e7f

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): update via SDK Studio (#161)
1 parent 9592662 commit 51f7e7f

File tree

4 files changed

+606
-810
lines changed

4 files changed

+606
-810
lines changed

src/resources/evaluations.ts

Lines changed: 165 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -62,53 +62,78 @@ export interface Evaluation {
6262
}
6363

6464
export namespace Evaluation {
65-
/**
66-
* The initial messages to be included with your call to the LLM API.
67-
*/
6865
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+
>;
7372

7473
role: 'assistant' | 'system' | 'tool' | 'user';
75-
76-
toolCallId: string | null;
77-
78-
toolCalls: Array<AppendedMessage.ToolCall> | null;
7974
}
8075

8176
export namespace AppendedMessage {
82-
export interface ToolCall {
83-
function: ToolCall.Function;
77+
export interface TextContentBlockSchema {
78+
text: string;
8479

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;
8987

90-
/**
91-
* The type of the tool. Currently, only `function` is supported.
92-
*/
93-
type: 'function';
88+
type: 'IMAGE_BASE64';
9489
}
9590

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+
98101
/**
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
103103
*/
104-
arguments: string;
104+
toolCallId: string;
105105

106106
/**
107-
* The name of the function to call.
107+
* The type of the tool. Currently, only `function` is supported.
108108
*/
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+
}
110127
}
111128
}
129+
130+
export interface ToolResultContentBlock {
131+
result: string;
132+
133+
toolCallId: string;
134+
135+
type: 'TOOL_RESULT';
136+
}
112137
}
113138
}
114139

@@ -133,53 +158,78 @@ export interface EvaluationCreateParams {
133158
}
134159

135160
export namespace EvaluationCreateParams {
136-
/**
137-
* The initial messages to be included with your call to the LLM API.
138-
*/
139161
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+
>;
144168

145169
role: 'assistant' | 'system' | 'tool' | 'user';
146-
147-
toolCallId: string | null;
148-
149-
toolCalls: Array<AppendedMessage.ToolCall> | null;
150170
}
151171

152172
export namespace AppendedMessage {
153-
export interface ToolCall {
154-
function: ToolCall.Function;
173+
export interface TextContentBlockSchema {
174+
text: string;
155175

156-
/**
157-
* TOOL_CALL_1
158-
*/
159-
toolCallId: string;
176+
type: 'TEXT';
177+
}
178+
179+
export interface ImageBase64ContentBlock {
180+
imageBase64: string;
160181

161-
/**
162-
* The type of the tool. Currently, only `function` is supported.
163-
*/
164-
type: 'function';
182+
mediaType: string;
183+
184+
type: 'IMAGE_BASE64';
165185
}
166186

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+
169197
/**
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
174199
*/
175-
arguments: string;
200+
toolCallId: string;
176201

177202
/**
178-
* The name of the function to call.
203+
* The type of the tool. Currently, only `function` is supported.
179204
*/
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+
}
181223
}
182224
}
225+
226+
export interface ToolResultContentBlock {
227+
result: string;
228+
229+
toolCallId: string;
230+
231+
type: 'TOOL_RESULT';
232+
}
183233
}
184234
}
185235

@@ -198,52 +248,77 @@ export interface EvaluationUpdateParams {
198248
}
199249

200250
export namespace EvaluationUpdateParams {
201-
/**
202-
* The initial messages to be included with your call to the LLM API.
203-
*/
204251
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+
>;
209258

210259
role: 'assistant' | 'system' | 'tool' | 'user';
211-
212-
toolCallId: string | null;
213-
214-
toolCalls: Array<AppendedMessage.ToolCall> | null;
215260
}
216261

217262
export namespace AppendedMessage {
218-
export interface ToolCall {
219-
function: ToolCall.Function;
263+
export interface TextContentBlockSchema {
264+
text: string;
220265

221-
/**
222-
* TOOL_CALL_1
223-
*/
224-
toolCallId: string;
266+
type: 'TEXT';
267+
}
268+
269+
export interface ImageBase64ContentBlock {
270+
imageBase64: string;
225271

226-
/**
227-
* The type of the tool. Currently, only `function` is supported.
228-
*/
229-
type: 'function';
272+
mediaType: string;
273+
274+
type: 'IMAGE_BASE64';
230275
}
231276

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+
234287
/**
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
239289
*/
240-
arguments: string;
290+
toolCallId: string;
241291

242292
/**
243-
* The name of the function to call.
293+
* The type of the tool. Currently, only `function` is supported.
244294
*/
245-
name: string;
295+
type: 'function';
246296
}
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';
247322
}
248323
}
249324
}

0 commit comments

Comments
 (0)