11// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22
33import * as Shared from './shared' ;
4- import * as InferenceAPI from './inference' ;
5- import * as ToolRuntimeAPI from './tool-runtime/tool-runtime' ;
64
75/**
86 * Configuration for an agent.
@@ -18,7 +16,7 @@ export interface AgentConfig {
1816 */
1917 model : string ;
2018
21- client_tools ?: Array < ToolRuntimeAPI . ToolDef > ;
19+ client_tools ?: Array < AgentConfig . ClientTool > ;
2220
2321 /**
2422 * Optional flag indicating whether session data has to be persisted
@@ -67,6 +65,63 @@ export interface AgentConfig {
6765}
6866
6967export 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+
70125 /**
71126 * Configuration for tool use.
72127 */
@@ -112,7 +167,56 @@ export interface BatchCompletion {
112167 /**
113168 * List of completion responses, one for each input in the batch
114169 */
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+ }
116220}
117221
118222/**
@@ -127,7 +231,7 @@ export interface ChatCompletionResponse {
127231 /**
128232 * Optional log probabilities for generated tokens
129233 */
130- logprobs ?: Array < InferenceAPI . TokenLogProbs > ;
234+ logprobs ?: Array < SharedTokenLogProbs > ;
131235
132236 /**
133237 * (Optional) List of metrics associated with the API response
@@ -912,6 +1016,16 @@ export interface ScoringResult {
9121016 score_rows : Array < { [ key : string ] : boolean | number | string | Array < unknown > | unknown | null } > ;
9131017}
9141018
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+
9151029/**
9161030 * A system message providing instructions or context to the model.
9171031 */
0 commit comments