llama-stack-client 0.2.16 → 0.2.17-rc1

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.
Files changed (152) hide show
  1. package/LICENSE +4 -198
  2. package/index.d.mts +2 -2
  3. package/index.d.ts +2 -2
  4. package/index.d.ts.map +1 -1
  5. package/index.js.map +1 -1
  6. package/index.mjs +1 -1
  7. package/index.mjs.map +1 -1
  8. package/package.json +2 -6
  9. package/resources/agents/agents.d.ts +29 -2
  10. package/resources/agents/agents.d.ts.map +1 -1
  11. package/resources/agents/agents.js.map +1 -1
  12. package/resources/agents/agents.mjs.map +1 -1
  13. package/resources/agents/session.d.ts +18 -0
  14. package/resources/agents/session.d.ts.map +1 -1
  15. package/resources/agents/steps.d.ts +4 -1
  16. package/resources/agents/steps.d.ts.map +1 -1
  17. package/resources/agents/turn.d.ts +113 -8
  18. package/resources/agents/turn.d.ts.map +1 -1
  19. package/resources/benchmarks.d.ts +15 -0
  20. package/resources/benchmarks.d.ts.map +1 -1
  21. package/resources/chat/chat.d.ts +24 -0
  22. package/resources/chat/chat.d.ts.map +1 -1
  23. package/resources/chat/chat.js.map +1 -1
  24. package/resources/chat/chat.mjs.map +1 -1
  25. package/resources/chat/completions.d.ts +648 -6
  26. package/resources/chat/completions.d.ts.map +1 -1
  27. package/resources/datasets.d.ts +42 -6
  28. package/resources/datasets.d.ts.map +1 -1
  29. package/resources/eval/eval.d.ts +9 -0
  30. package/resources/eval/eval.d.ts.map +1 -1
  31. package/resources/eval/eval.js.map +1 -1
  32. package/resources/eval/eval.mjs.map +1 -1
  33. package/resources/files.d.ts +9 -0
  34. package/resources/files.d.ts.map +1 -1
  35. package/resources/index.d.ts +1 -1
  36. package/resources/index.d.ts.map +1 -1
  37. package/resources/index.js.map +1 -1
  38. package/resources/index.mjs +1 -1
  39. package/resources/index.mjs.map +1 -1
  40. package/resources/inference.d.ts +36 -0
  41. package/resources/inference.d.ts.map +1 -1
  42. package/resources/inspect.d.ts +45 -1
  43. package/resources/inspect.d.ts.map +1 -1
  44. package/resources/inspect.js +1 -1
  45. package/resources/inspect.mjs +1 -1
  46. package/resources/models.d.ts +21 -0
  47. package/resources/models.d.ts.map +1 -1
  48. package/resources/post-training/job.d.ts +95 -2
  49. package/resources/post-training/job.d.ts.map +1 -1
  50. package/resources/post-training/post-training.d.ts +206 -0
  51. package/resources/post-training/post-training.d.ts.map +1 -1
  52. package/resources/post-training/post-training.js.map +1 -1
  53. package/resources/post-training/post-training.mjs.map +1 -1
  54. package/resources/providers.d.ts +9 -0
  55. package/resources/providers.d.ts.map +1 -1
  56. package/resources/responses/input-items.d.ts +114 -0
  57. package/resources/responses/input-items.d.ts.map +1 -1
  58. package/resources/responses/responses.d.ts +1265 -12
  59. package/resources/responses/responses.d.ts.map +1 -1
  60. package/resources/responses/responses.js.map +1 -1
  61. package/resources/responses/responses.mjs.map +1 -1
  62. package/resources/routes.d.ts +10 -1
  63. package/resources/routes.d.ts.map +1 -1
  64. package/resources/routes.js +1 -1
  65. package/resources/routes.mjs +1 -1
  66. package/resources/safety.d.ts +72 -1
  67. package/resources/safety.d.ts.map +1 -1
  68. package/resources/safety.js +6 -0
  69. package/resources/safety.js.map +1 -1
  70. package/resources/safety.mjs +6 -0
  71. package/resources/safety.mjs.map +1 -1
  72. package/resources/scoring-functions.d.ts +51 -0
  73. package/resources/scoring-functions.d.ts.map +1 -1
  74. package/resources/scoring.d.ts +9 -0
  75. package/resources/scoring.d.ts.map +1 -1
  76. package/resources/shared.d.ts +209 -3
  77. package/resources/shared.d.ts.map +1 -1
  78. package/resources/shields.d.ts +7 -1
  79. package/resources/shields.d.ts.map +1 -1
  80. package/resources/synthetic-data-generation.d.ts +18 -1
  81. package/resources/synthetic-data-generation.d.ts.map +1 -1
  82. package/resources/synthetic-data-generation.js +3 -0
  83. package/resources/synthetic-data-generation.js.map +1 -1
  84. package/resources/synthetic-data-generation.mjs +3 -0
  85. package/resources/synthetic-data-generation.mjs.map +1 -1
  86. package/resources/telemetry.d.ts +214 -0
  87. package/resources/telemetry.d.ts.map +1 -1
  88. package/resources/tool-runtime/rag-tool.d.ts +16 -4
  89. package/resources/tool-runtime/rag-tool.d.ts.map +1 -1
  90. package/resources/tool-runtime/rag-tool.js +2 -2
  91. package/resources/tool-runtime/rag-tool.mjs +2 -2
  92. package/resources/tool-runtime/tool-runtime.d.ts +52 -1
  93. package/resources/tool-runtime/tool-runtime.d.ts.map +1 -1
  94. package/resources/tool-runtime/tool-runtime.js.map +1 -1
  95. package/resources/tool-runtime/tool-runtime.mjs.map +1 -1
  96. package/resources/toolgroups.d.ts +30 -0
  97. package/resources/toolgroups.d.ts.map +1 -1
  98. package/resources/tools.d.ts +45 -0
  99. package/resources/tools.d.ts.map +1 -1
  100. package/resources/vector-dbs.d.ts +45 -0
  101. package/resources/vector-dbs.d.ts.map +1 -1
  102. package/resources/vector-io.d.ts +9 -0
  103. package/resources/vector-io.d.ts.map +1 -1
  104. package/resources/vector-stores/files.d.ts +149 -1
  105. package/resources/vector-stores/files.d.ts.map +1 -1
  106. package/resources/vector-stores/vector-stores.d.ts +121 -1
  107. package/resources/vector-stores/vector-stores.d.ts.map +1 -1
  108. package/resources/vector-stores/vector-stores.js.map +1 -1
  109. package/resources/vector-stores/vector-stores.mjs.map +1 -1
  110. package/src/index.ts +9 -1
  111. package/src/resources/agents/agents.ts +29 -2
  112. package/src/resources/agents/session.ts +18 -0
  113. package/src/resources/agents/steps.ts +4 -1
  114. package/src/resources/agents/turn.ts +113 -8
  115. package/src/resources/benchmarks.ts +15 -0
  116. package/src/resources/chat/chat.ts +24 -0
  117. package/src/resources/chat/completions.ts +678 -0
  118. package/src/resources/datasets.ts +42 -6
  119. package/src/resources/eval/eval.ts +9 -0
  120. package/src/resources/files.ts +9 -0
  121. package/src/resources/index.ts +7 -1
  122. package/src/resources/inference.ts +36 -0
  123. package/src/resources/inspect.ts +45 -1
  124. package/src/resources/models.ts +21 -0
  125. package/src/resources/post-training/job.ts +95 -2
  126. package/src/resources/post-training/post-training.ts +206 -0
  127. package/src/resources/providers.ts +9 -0
  128. package/src/resources/responses/input-items.ts +114 -0
  129. package/src/resources/responses/responses.ts +1265 -12
  130. package/src/resources/routes.ts +10 -1
  131. package/src/resources/safety.ts +83 -1
  132. package/src/resources/scoring-functions.ts +51 -0
  133. package/src/resources/scoring.ts +9 -0
  134. package/src/resources/shared.ts +209 -3
  135. package/src/resources/shields.ts +7 -1
  136. package/src/resources/synthetic-data-generation.ts +18 -1
  137. package/src/resources/telemetry.ts +214 -0
  138. package/src/resources/tool-runtime/rag-tool.ts +16 -4
  139. package/src/resources/tool-runtime/tool-runtime.ts +52 -1
  140. package/src/resources/toolgroups.ts +30 -0
  141. package/src/resources/tools.ts +45 -0
  142. package/src/resources/vector-dbs.ts +45 -0
  143. package/src/resources/vector-io.ts +9 -0
  144. package/src/resources/vector-stores/files.ts +149 -1
  145. package/src/resources/vector-stores/vector-stores.ts +121 -1
  146. package/src/version.ts +1 -1
  147. package/version.d.ts +1 -1
  148. package/version.d.ts.map +1 -1
  149. package/version.js +1 -1
  150. package/version.js.map +1 -1
  151. package/version.mjs +1 -1
  152. package/version.mjs.map +1 -1
@@ -6,7 +6,7 @@ import * as InspectAPI from './inspect';
6
6
 
7
7
  export class Routes extends APIResource {
8
8
  /**
9
- * List all routes.
9
+ * List all available API routes with their methods and implementing providers.
10
10
  */
11
11
  list(options?: Core.RequestOptions): Core.APIPromise<RouteListResponse> {
12
12
  return (
@@ -15,10 +15,19 @@ export class Routes extends APIResource {
15
15
  }
16
16
  }
17
17
 
18
+ /**
19
+ * Response containing a list of all available API routes.
20
+ */
18
21
  export interface ListRoutesResponse {
22
+ /**
23
+ * List of available route information objects
24
+ */
19
25
  data: RouteListResponse;
20
26
  }
21
27
 
28
+ /**
29
+ * List of available route information objects
30
+ */
22
31
  export type RouteListResponse = Array<InspectAPI.RouteInfo>;
23
32
 
24
33
  export declare namespace Routes {
@@ -5,6 +5,13 @@ import * as Core from '../core';
5
5
  import * as Shared from './shared';
6
6
 
7
7
  export class Safety extends APIResource {
8
+ /**
9
+ * Classifies if text and/or image inputs are potentially harmful.
10
+ */
11
+ create(body: SafetyCreateParams, options?: Core.RequestOptions): Core.APIPromise<CreateResponse> {
12
+ return this._client.post('/v1/openai/v1/moderations', { body, ...options });
13
+ }
14
+
8
15
  /**
9
16
  * Run a shield.
10
17
  */
@@ -13,10 +20,80 @@ export class Safety extends APIResource {
13
20
  }
14
21
  }
15
22
 
23
+ /**
24
+ * A moderation object.
25
+ */
26
+ export interface CreateResponse {
27
+ /**
28
+ * The unique identifier for the moderation request.
29
+ */
30
+ id: string;
31
+
32
+ /**
33
+ * The model used to generate the moderation results.
34
+ */
35
+ model: string;
36
+
37
+ /**
38
+ * A list of moderation objects
39
+ */
40
+ results: Array<CreateResponse.Result>;
41
+ }
42
+
43
+ export namespace CreateResponse {
44
+ /**
45
+ * A moderation object.
46
+ */
47
+ export interface Result {
48
+ /**
49
+ * Whether any of the below categories are flagged.
50
+ */
51
+ flagged: boolean;
52
+
53
+ metadata: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
54
+
55
+ /**
56
+ * A list of the categories, and whether they are flagged or not.
57
+ */
58
+ categories?: { [key: string]: boolean };
59
+
60
+ /**
61
+ * A list of the categories along with the input type(s) that the score applies to.
62
+ */
63
+ category_applied_input_types?: { [key: string]: Array<string> };
64
+
65
+ /**
66
+ * A list of the categories along with their scores as predicted by model.
67
+ */
68
+ category_scores?: { [key: string]: number };
69
+
70
+ user_message?: string;
71
+ }
72
+ }
73
+
74
+ /**
75
+ * Response from running a safety shield.
76
+ */
16
77
  export interface RunShieldResponse {
78
+ /**
79
+ * (Optional) Safety violation detected by the shield, if any
80
+ */
17
81
  violation?: Shared.SafetyViolation;
18
82
  }
19
83
 
84
+ export interface SafetyCreateParams {
85
+ /**
86
+ * Input (or inputs) to classify. Can be a single string, an array of strings, or
87
+ * an array of multi-modal input objects similar to other models.
88
+ */
89
+ input: string | Array<string>;
90
+
91
+ /**
92
+ * The content moderation model you would like to use.
93
+ */
94
+ model: string;
95
+ }
96
+
20
97
  export interface SafetyRunShieldParams {
21
98
  /**
22
99
  * The messages to run the shield on.
@@ -35,5 +112,10 @@ export interface SafetyRunShieldParams {
35
112
  }
36
113
 
37
114
  export declare namespace Safety {
38
- export { type RunShieldResponse as RunShieldResponse, type SafetyRunShieldParams as SafetyRunShieldParams };
115
+ export {
116
+ type CreateResponse as CreateResponse,
117
+ type RunShieldResponse as RunShieldResponse,
118
+ type SafetyCreateParams as SafetyCreateParams,
119
+ type SafetyRunShieldParams as SafetyRunShieldParams,
120
+ };
39
121
  }
@@ -39,6 +39,9 @@ export interface ListScoringFunctionsResponse {
39
39
  data: ScoringFunctionListResponse;
40
40
  }
41
41
 
42
+ /**
43
+ * A scoring function resource for evaluating model outputs.
44
+ */
42
45
  export interface ScoringFn {
43
46
  identifier: string;
44
47
 
@@ -48,50 +51,98 @@ export interface ScoringFn {
48
51
 
49
52
  return_type: Shared.ReturnType;
50
53
 
54
+ /**
55
+ * The resource type, always scoring_function
56
+ */
51
57
  type: 'scoring_function';
52
58
 
53
59
  description?: string;
54
60
 
61
+ /**
62
+ * Parameters for LLM-as-judge scoring function configuration.
63
+ */
55
64
  params?: ScoringFnParams;
56
65
 
57
66
  provider_resource_id?: string;
58
67
  }
59
68
 
69
+ /**
70
+ * Parameters for LLM-as-judge scoring function configuration.
71
+ */
60
72
  export type ScoringFnParams =
61
73
  | ScoringFnParams.LlmAsJudgeScoringFnParams
62
74
  | ScoringFnParams.RegexParserScoringFnParams
63
75
  | ScoringFnParams.BasicScoringFnParams;
64
76
 
65
77
  export namespace ScoringFnParams {
78
+ /**
79
+ * Parameters for LLM-as-judge scoring function configuration.
80
+ */
66
81
  export interface LlmAsJudgeScoringFnParams {
82
+ /**
83
+ * Aggregation functions to apply to the scores of each row
84
+ */
67
85
  aggregation_functions: Array<
68
86
  'average' | 'weighted_average' | 'median' | 'categorical_count' | 'accuracy'
69
87
  >;
70
88
 
89
+ /**
90
+ * Identifier of the LLM model to use as a judge for scoring
91
+ */
71
92
  judge_model: string;
72
93
 
94
+ /**
95
+ * Regexes to extract the answer from generated response
96
+ */
73
97
  judge_score_regexes: Array<string>;
74
98
 
99
+ /**
100
+ * The type of scoring function parameters, always llm_as_judge
101
+ */
75
102
  type: 'llm_as_judge';
76
103
 
104
+ /**
105
+ * (Optional) Custom prompt template for the judge model
106
+ */
77
107
  prompt_template?: string;
78
108
  }
79
109
 
110
+ /**
111
+ * Parameters for regex parser scoring function configuration.
112
+ */
80
113
  export interface RegexParserScoringFnParams {
114
+ /**
115
+ * Aggregation functions to apply to the scores of each row
116
+ */
81
117
  aggregation_functions: Array<
82
118
  'average' | 'weighted_average' | 'median' | 'categorical_count' | 'accuracy'
83
119
  >;
84
120
 
121
+ /**
122
+ * Regex to extract the answer from generated response
123
+ */
85
124
  parsing_regexes: Array<string>;
86
125
 
126
+ /**
127
+ * The type of scoring function parameters, always regex_parser
128
+ */
87
129
  type: 'regex_parser';
88
130
  }
89
131
 
132
+ /**
133
+ * Parameters for basic scoring function configuration.
134
+ */
90
135
  export interface BasicScoringFnParams {
136
+ /**
137
+ * Aggregation functions to apply to the scores of each row
138
+ */
91
139
  aggregation_functions: Array<
92
140
  'average' | 'weighted_average' | 'median' | 'categorical_count' | 'accuracy'
93
141
  >;
94
142
 
143
+ /**
144
+ * The type of scoring function parameters, always basic
145
+ */
95
146
  type: 'basic';
96
147
  }
97
148
  }
@@ -34,9 +34,18 @@ export interface ScoringScoreResponse {
34
34
  results: { [key: string]: Shared.ScoringResult };
35
35
  }
36
36
 
37
+ /**
38
+ * Response from batch scoring operations on datasets.
39
+ */
37
40
  export interface ScoringScoreBatchResponse {
41
+ /**
42
+ * A map of scoring function name to ScoringResult
43
+ */
38
44
  results: { [key: string]: Shared.ScoringResult };
39
45
 
46
+ /**
47
+ * (Optional) The identifier of the dataset that was scored
48
+ */
40
49
  dataset_id?: string;
41
50
  }
42
51
 
@@ -105,7 +105,13 @@ export namespace AgentConfig {
105
105
  }
106
106
  }
107
107
 
108
+ /**
109
+ * Response from a batch completion request.
110
+ */
108
111
  export interface BatchCompletion {
112
+ /**
113
+ * List of completion responses, one for each input in the batch
114
+ */
109
115
  batch: Array<InferenceAPI.CompletionResponse>;
110
116
  }
111
117
 
@@ -123,15 +129,30 @@ export interface ChatCompletionResponse {
123
129
  */
124
130
  logprobs?: Array<InferenceAPI.TokenLogProbs>;
125
131
 
132
+ /**
133
+ * (Optional) List of metrics associated with the API response
134
+ */
126
135
  metrics?: Array<ChatCompletionResponse.Metric>;
127
136
  }
128
137
 
129
138
  export namespace ChatCompletionResponse {
139
+ /**
140
+ * A metric value included in API responses.
141
+ */
130
142
  export interface Metric {
143
+ /**
144
+ * The name of the metric
145
+ */
131
146
  metric: string;
132
147
 
148
+ /**
149
+ * The numeric value of the metric
150
+ */
133
151
  value: number;
134
152
 
153
+ /**
154
+ * (Optional) The unit of measurement for the metric value
155
+ */
135
156
  unit?: string;
136
157
  }
137
158
  }
@@ -166,26 +187,59 @@ export interface CompletionMessage {
166
187
  tool_calls?: Array<ToolCall>;
167
188
  }
168
189
 
190
+ /**
191
+ * A text content delta for streaming responses.
192
+ */
169
193
  export type ContentDelta = ContentDelta.TextDelta | ContentDelta.ImageDelta | ContentDelta.ToolCallDelta;
170
194
 
171
195
  export namespace ContentDelta {
196
+ /**
197
+ * A text content delta for streaming responses.
198
+ */
172
199
  export interface TextDelta {
200
+ /**
201
+ * The incremental text content
202
+ */
173
203
  text: string;
174
204
 
205
+ /**
206
+ * Discriminator type of the delta. Always "text"
207
+ */
175
208
  type: 'text';
176
209
  }
177
210
 
211
+ /**
212
+ * An image content delta for streaming responses.
213
+ */
178
214
  export interface ImageDelta {
215
+ /**
216
+ * The incremental image data as bytes
217
+ */
179
218
  image: string;
180
219
 
220
+ /**
221
+ * Discriminator type of the delta. Always "image"
222
+ */
181
223
  type: 'image';
182
224
  }
183
225
 
226
+ /**
227
+ * A tool call content delta for streaming responses.
228
+ */
184
229
  export interface ToolCallDelta {
230
+ /**
231
+ * Current parsing status of the tool call
232
+ */
185
233
  parse_status: 'started' | 'in_progress' | 'failed' | 'succeeded';
186
234
 
235
+ /**
236
+ * Either an in-progress tool call string or the final parsed tool call
237
+ */
187
238
  tool_call: Shared.ToolCallOrString;
188
239
 
240
+ /**
241
+ * Discriminator type of the delta. Always "tool_call"
242
+ */
189
243
  type: 'tool_call';
190
244
  }
191
245
  }
@@ -259,6 +313,9 @@ export namespace Document {
259
313
  * Note that URL could have length limits.
260
314
  */
261
315
  export interface URL {
316
+ /**
317
+ * The URL string pointing to the resource
318
+ */
262
319
  uri: string;
263
320
  }
264
321
  }
@@ -279,7 +336,13 @@ export namespace Document {
279
336
  type: 'text';
280
337
  }
281
338
 
339
+ /**
340
+ * A URL reference to external content.
341
+ */
282
342
  export interface URL {
343
+ /**
344
+ * The URL string pointing to the resource
345
+ */
283
346
  uri: string;
284
347
  }
285
348
  }
@@ -332,6 +395,9 @@ export namespace InterleavedContent {
332
395
  * Note that URL could have length limits.
333
396
  */
334
397
  export interface URL {
398
+ /**
399
+ * The URL string pointing to the resource
400
+ */
335
401
  uri: string;
336
402
  }
337
403
  }
@@ -399,6 +465,9 @@ export namespace InterleavedContentItem {
399
465
  * Note that URL could have length limits.
400
466
  */
401
467
  export interface URL {
468
+ /**
469
+ * The URL string pointing to the resource
470
+ */
402
471
  uri: string;
403
472
  }
404
473
  }
@@ -425,6 +494,9 @@ export namespace InterleavedContentItem {
425
494
  */
426
495
  export type Message = UserMessage | SystemMessage | ToolResponseMessage | CompletionMessage;
427
496
 
497
+ /**
498
+ * Parameter type for string values.
499
+ */
428
500
  export type ParamType =
429
501
  | ParamType.StringType
430
502
  | ParamType.NumberType
@@ -438,43 +510,103 @@ export type ParamType =
438
510
  | ParamType.AgentTurnInputType;
439
511
 
440
512
  export namespace ParamType {
513
+ /**
514
+ * Parameter type for string values.
515
+ */
441
516
  export interface StringType {
517
+ /**
518
+ * Discriminator type. Always "string"
519
+ */
442
520
  type: 'string';
443
521
  }
444
522
 
523
+ /**
524
+ * Parameter type for numeric values.
525
+ */
445
526
  export interface NumberType {
527
+ /**
528
+ * Discriminator type. Always "number"
529
+ */
446
530
  type: 'number';
447
531
  }
448
532
 
533
+ /**
534
+ * Parameter type for boolean values.
535
+ */
449
536
  export interface BooleanType {
537
+ /**
538
+ * Discriminator type. Always "boolean"
539
+ */
450
540
  type: 'boolean';
451
541
  }
452
542
 
543
+ /**
544
+ * Parameter type for array values.
545
+ */
453
546
  export interface ArrayType {
547
+ /**
548
+ * Discriminator type. Always "array"
549
+ */
454
550
  type: 'array';
455
551
  }
456
552
 
553
+ /**
554
+ * Parameter type for object values.
555
+ */
457
556
  export interface ObjectType {
557
+ /**
558
+ * Discriminator type. Always "object"
559
+ */
458
560
  type: 'object';
459
561
  }
460
562
 
563
+ /**
564
+ * Parameter type for JSON values.
565
+ */
461
566
  export interface JsonType {
567
+ /**
568
+ * Discriminator type. Always "json"
569
+ */
462
570
  type: 'json';
463
571
  }
464
572
 
573
+ /**
574
+ * Parameter type for union values.
575
+ */
465
576
  export interface UnionType {
577
+ /**
578
+ * Discriminator type. Always "union"
579
+ */
466
580
  type: 'union';
467
581
  }
468
582
 
583
+ /**
584
+ * Parameter type for chat completion input.
585
+ */
469
586
  export interface ChatCompletionInputType {
587
+ /**
588
+ * Discriminator type. Always "chat_completion_input"
589
+ */
470
590
  type: 'chat_completion_input';
471
591
  }
472
592
 
593
+ /**
594
+ * Parameter type for completion input.
595
+ */
473
596
  export interface CompletionInputType {
597
+ /**
598
+ * Discriminator type. Always "completion_input"
599
+ */
474
600
  type: 'completion_input';
475
601
  }
476
602
 
603
+ /**
604
+ * Parameter type for agent turn input.
605
+ */
477
606
  export interface AgentTurnInputType {
607
+ /**
608
+ * Discriminator type. Always "agent_turn_input"
609
+ */
478
610
  type: 'agent_turn_input';
479
611
  }
480
612
  }
@@ -525,8 +657,7 @@ export namespace QueryConfig {
525
657
  export interface RrfRanker {
526
658
  /**
527
659
  * The impact factor for RRF scoring. Higher values give more weight to
528
- * higher-ranked results. Must be greater than 0. Default of 60 is from the
529
- * original RRF paper (Cormack et al., 2009).
660
+ * higher-ranked results. Must be greater than 0
530
661
  */
531
662
  impact_factor: number;
532
663
 
@@ -553,31 +684,61 @@ export namespace QueryConfig {
553
684
  }
554
685
  }
555
686
 
687
+ /**
688
+ * Configuration for the default RAG query generator.
689
+ */
556
690
  export type QueryGeneratorConfig =
557
691
  | QueryGeneratorConfig.DefaultRagQueryGeneratorConfig
558
692
  | QueryGeneratorConfig.LlmragQueryGeneratorConfig;
559
693
 
560
694
  export namespace QueryGeneratorConfig {
695
+ /**
696
+ * Configuration for the default RAG query generator.
697
+ */
561
698
  export interface DefaultRagQueryGeneratorConfig {
699
+ /**
700
+ * String separator used to join query terms
701
+ */
562
702
  separator: string;
563
703
 
704
+ /**
705
+ * Type of query generator, always 'default'
706
+ */
564
707
  type: 'default';
565
708
  }
566
709
 
710
+ /**
711
+ * Configuration for the LLM-based RAG query generator.
712
+ */
567
713
  export interface LlmragQueryGeneratorConfig {
714
+ /**
715
+ * Name of the language model to use for query generation
716
+ */
568
717
  model: string;
569
718
 
719
+ /**
720
+ * Template string for formatting the query generation prompt
721
+ */
570
722
  template: string;
571
723
 
724
+ /**
725
+ * Type of query generator, always 'llm'
726
+ */
572
727
  type: 'llm';
573
728
  }
574
729
  }
575
730
 
731
+ /**
732
+ * Result of a RAG query containing retrieved content and metadata.
733
+ */
576
734
  export interface QueryResult {
735
+ /**
736
+ * Additional metadata about the query result
737
+ */
577
738
  metadata: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
578
739
 
579
740
  /**
580
- * A image content item
741
+ * (Optional) The retrieved content from the query
581
742
  */
582
743
  content?: InterleavedContent;
583
744
  }
@@ -634,11 +795,24 @@ export interface ReturnType {
634
795
  | 'agent_turn_input';
635
796
  }
636
797
 
798
+ /**
799
+ * Details of a safety violation detected by content moderation.
800
+ */
637
801
  export interface SafetyViolation {
802
+ /**
803
+ * Additional metadata including specific violation codes for debugging and
804
+ * telemetry
805
+ */
638
806
  metadata: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
639
807
 
808
+ /**
809
+ * Severity level of the violation
810
+ */
640
811
  violation_level: 'info' | 'warn' | 'error';
641
812
 
813
+ /**
814
+ * (Optional) Message to convey to the user about the violation
815
+ */
642
816
  user_message?: string;
643
817
  }
644
818
 
@@ -675,21 +849,50 @@ export interface SamplingParams {
675
849
  }
676
850
 
677
851
  export namespace SamplingParams {
852
+ /**
853
+ * Greedy sampling strategy that selects the highest probability token at each
854
+ * step.
855
+ */
678
856
  export interface GreedySamplingStrategy {
857
+ /**
858
+ * Must be "greedy" to identify this sampling strategy
859
+ */
679
860
  type: 'greedy';
680
861
  }
681
862
 
863
+ /**
864
+ * Top-p (nucleus) sampling strategy that samples from the smallest set of tokens
865
+ * with cumulative probability >= p.
866
+ */
682
867
  export interface TopPSamplingStrategy {
868
+ /**
869
+ * Must be "top_p" to identify this sampling strategy
870
+ */
683
871
  type: 'top_p';
684
872
 
873
+ /**
874
+ * Controls randomness in sampling. Higher values increase randomness
875
+ */
685
876
  temperature?: number;
686
877
 
878
+ /**
879
+ * Cumulative probability threshold for nucleus sampling. Defaults to 0.95
880
+ */
687
881
  top_p?: number;
688
882
  }
689
883
 
884
+ /**
885
+ * Top-k sampling strategy that restricts sampling to the k most likely tokens.
886
+ */
690
887
  export interface TopKSamplingStrategy {
888
+ /**
889
+ * Number of top tokens to consider for sampling. Must be at least 1
890
+ */
691
891
  top_k: number;
692
892
 
893
+ /**
894
+ * Must be "top_k" to identify this sampling strategy
895
+ */
693
896
  type: 'top_k';
694
897
  }
695
898
  }
@@ -746,6 +949,9 @@ export interface ToolCall {
746
949
  arguments_json?: string;
747
950
  }
748
951
 
952
+ /**
953
+ * Either an in-progress tool call string or the final parsed tool call
954
+ */
749
955
  export type ToolCallOrString = string | ToolCall;
750
956
 
751
957
  export interface ToolParamDefinition {
@@ -33,15 +33,21 @@ export interface ListShieldsResponse {
33
33
  }
34
34
 
35
35
  /**
36
- * A safety shield resource that can be used to check content
36
+ * A safety shield resource that can be used to check content.
37
37
  */
38
38
  export interface Shield {
39
39
  identifier: string;
40
40
 
41
41
  provider_id: string;
42
42
 
43
+ /**
44
+ * The resource type, always shield
45
+ */
43
46
  type: 'shield';
44
47
 
48
+ /**
49
+ * (Optional) Configuration parameters for the shield
50
+ */
45
51
  params?: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
46
52
 
47
53
  provider_resource_id?: string;