1
1
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
3
3
import * as Shared from './shared' ;
4
- import * as InferenceAPI from './inference' ;
5
- import * as ToolRuntimeAPI from './tool-runtime/tool-runtime' ;
6
4
7
5
/**
8
6
* Configuration for an agent.
@@ -18,7 +16,7 @@ export interface AgentConfig {
18
16
*/
19
17
model : string ;
20
18
21
- client_tools ?: Array < ToolRuntimeAPI . ToolDef > ;
19
+ client_tools ?: Array < AgentConfig . ClientTool > ;
22
20
23
21
/**
24
22
* Optional flag indicating whether session data has to be persisted
@@ -67,6 +65,63 @@ export interface AgentConfig {
67
65
}
68
66
69
67
export namespace AgentConfig {
68
+ /**
69
+ * Tool definition used in runtime contexts.
70
+ */
71
+ export interface ClientTool {
72
+ /**
73
+ * Name of the tool
74
+ */
75
+ name : string ;
76
+
77
+ /**
78
+ * (Optional) Human-readable description of what the tool does
79
+ */
80
+ description ?: string ;
81
+
82
+ /**
83
+ * (Optional) Additional metadata about the tool
84
+ */
85
+ metadata ?: { [ key : string ] : boolean | number | string | Array < unknown > | unknown | null } ;
86
+
87
+ /**
88
+ * (Optional) List of parameters this tool accepts
89
+ */
90
+ parameters ?: Array < ClientTool . Parameter > ;
91
+ }
92
+
93
+ export namespace ClientTool {
94
+ /**
95
+ * Parameter definition for a tool.
96
+ */
97
+ export interface Parameter {
98
+ /**
99
+ * Human-readable description of what the parameter does
100
+ */
101
+ description : string ;
102
+
103
+ /**
104
+ * Name of the parameter
105
+ */
106
+ name : string ;
107
+
108
+ /**
109
+ * Type of the parameter (e.g., string, integer)
110
+ */
111
+ parameter_type : string ;
112
+
113
+ /**
114
+ * Whether this parameter is required for tool invocation
115
+ */
116
+ required : boolean ;
117
+
118
+ /**
119
+ * (Optional) Default value for the parameter if not provided
120
+ */
121
+ default ?: boolean | number | string | Array < unknown > | unknown | null ;
122
+ }
123
+ }
124
+
70
125
/**
71
126
* Configuration for tool use.
72
127
*/
@@ -112,7 +167,56 @@ export interface BatchCompletion {
112
167
/**
113
168
* List of completion responses, one for each input in the batch
114
169
*/
115
- batch : Array < InferenceAPI . CompletionResponse > ;
170
+ batch : Array < BatchCompletion . Batch > ;
171
+ }
172
+
173
+ export namespace BatchCompletion {
174
+ /**
175
+ * Response from a completion request.
176
+ */
177
+ export interface Batch {
178
+ /**
179
+ * The generated completion text
180
+ */
181
+ content : string ;
182
+
183
+ /**
184
+ * Reason why generation stopped
185
+ */
186
+ stop_reason : 'end_of_turn' | 'end_of_message' | 'out_of_tokens' ;
187
+
188
+ /**
189
+ * Optional log probabilities for generated tokens
190
+ */
191
+ logprobs ?: Array < Shared . SharedTokenLogProbs > ;
192
+
193
+ /**
194
+ * (Optional) List of metrics associated with the API response
195
+ */
196
+ metrics ?: Array < Batch . Metric > ;
197
+ }
198
+
199
+ export namespace Batch {
200
+ /**
201
+ * A metric value included in API responses.
202
+ */
203
+ export interface Metric {
204
+ /**
205
+ * The name of the metric
206
+ */
207
+ metric : string ;
208
+
209
+ /**
210
+ * The numeric value of the metric
211
+ */
212
+ value : number ;
213
+
214
+ /**
215
+ * (Optional) The unit of measurement for the metric value
216
+ */
217
+ unit ?: string ;
218
+ }
219
+ }
116
220
}
117
221
118
222
/**
@@ -127,7 +231,7 @@ export interface ChatCompletionResponse {
127
231
/**
128
232
* Optional log probabilities for generated tokens
129
233
*/
130
- logprobs ?: Array < InferenceAPI . TokenLogProbs > ;
234
+ logprobs ?: Array < SharedTokenLogProbs > ;
131
235
132
236
/**
133
237
* (Optional) List of metrics associated with the API response
@@ -912,6 +1016,16 @@ export interface ScoringResult {
912
1016
score_rows : Array < { [ key : string ] : boolean | number | string | Array < unknown > | unknown | null } > ;
913
1017
}
914
1018
1019
+ /**
1020
+ * Log probabilities for generated tokens.
1021
+ */
1022
+ export interface SharedTokenLogProbs {
1023
+ /**
1024
+ * Dictionary mapping tokens to their log probabilities
1025
+ */
1026
+ logprobs_by_token : { [ key : string ] : number } ;
1027
+ }
1028
+
915
1029
/**
916
1030
* A system message providing instructions or context to the model.
917
1031
*/
0 commit comments