llama-stack-client 0.4.4 → 0.4.5
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.
- package/.github/workflows/ci.yml +4 -4
- package/.github/workflows/release-doctor.yml +1 -1
- package/.release-please-manifest.json +1 -1
- package/.stats.yml +4 -4
- package/CHANGELOG.md +41 -0
- package/LICENSE +1 -1
- package/README.md +41 -27
- package/api.md +32 -25
- package/dist/CHANGELOG.md +41 -0
- package/dist/LICENSE +1 -1
- package/dist/README.md +41 -27
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +5 -0
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +5 -0
- package/dist/core.mjs.map +1 -1
- package/dist/index.d.mts +12 -6
- package/dist/index.d.ts +12 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +1 -1
- package/dist/resources/alpha/admin.d.ts +41 -0
- package/dist/resources/alpha/admin.d.ts.map +1 -0
- package/dist/resources/alpha/admin.js +46 -0
- package/dist/resources/alpha/admin.js.map +1 -0
- package/dist/resources/alpha/admin.mjs +42 -0
- package/dist/resources/alpha/admin.mjs.map +1 -0
- package/dist/resources/alpha/alpha.d.ts +8 -4
- package/dist/resources/alpha/alpha.d.ts.map +1 -1
- package/dist/resources/alpha/alpha.js +6 -2
- package/dist/resources/alpha/alpha.js.map +1 -1
- package/dist/resources/alpha/alpha.mjs +6 -2
- package/dist/resources/alpha/alpha.mjs.map +1 -1
- package/dist/resources/alpha/benchmarks.d.ts +37 -1
- package/dist/resources/alpha/benchmarks.d.ts.map +1 -1
- package/dist/resources/alpha/eval/eval.d.ts +28 -7
- package/dist/resources/alpha/eval/eval.d.ts.map +1 -1
- package/dist/resources/alpha/eval/eval.js.map +1 -1
- package/dist/resources/alpha/eval/eval.mjs.map +1 -1
- package/dist/resources/alpha/index.d.ts +2 -1
- package/dist/resources/alpha/index.d.ts.map +1 -1
- package/dist/resources/alpha/index.js +3 -1
- package/dist/resources/alpha/index.js.map +1 -1
- package/dist/resources/alpha/index.mjs +1 -0
- package/dist/resources/alpha/index.mjs.map +1 -1
- package/dist/resources/alpha/inference.d.ts +58 -7
- package/dist/resources/alpha/inference.d.ts.map +1 -1
- package/dist/resources/alpha/post-training/index.d.ts +2 -2
- package/dist/resources/alpha/post-training/index.d.ts.map +1 -1
- package/dist/resources/alpha/post-training/index.js.map +1 -1
- package/dist/resources/alpha/post-training/index.mjs +1 -1
- package/dist/resources/alpha/post-training/index.mjs.map +1 -1
- package/dist/resources/alpha/post-training/job.d.ts +4 -16
- package/dist/resources/alpha/post-training/job.d.ts.map +1 -1
- package/dist/resources/alpha/post-training/job.js +5 -6
- package/dist/resources/alpha/post-training/job.js.map +1 -1
- package/dist/resources/alpha/post-training/job.mjs +5 -6
- package/dist/resources/alpha/post-training/job.mjs.map +1 -1
- package/dist/resources/alpha/post-training/post-training.d.ts +38 -11
- package/dist/resources/alpha/post-training/post-training.d.ts.map +1 -1
- package/dist/resources/alpha/post-training/post-training.js.map +1 -1
- package/dist/resources/alpha/post-training/post-training.mjs +1 -1
- package/dist/resources/alpha/post-training/post-training.mjs.map +1 -1
- package/dist/resources/beta/datasets.d.ts +102 -8
- package/dist/resources/beta/datasets.d.ts.map +1 -1
- package/dist/resources/chat/chat.d.ts +119 -17
- package/dist/resources/chat/chat.d.ts.map +1 -1
- package/dist/resources/chat/chat.js.map +1 -1
- package/dist/resources/chat/chat.mjs.map +1 -1
- package/dist/resources/chat/completions.d.ts +1130 -73
- package/dist/resources/chat/completions.d.ts.map +1 -1
- package/dist/resources/chat/completions.js +0 -2
- package/dist/resources/chat/completions.js.map +1 -1
- package/dist/resources/chat/completions.mjs +0 -2
- package/dist/resources/chat/completions.mjs.map +1 -1
- package/dist/resources/completions.d.ts +135 -26
- package/dist/resources/completions.d.ts.map +1 -1
- package/dist/resources/completions.js.map +1 -1
- package/dist/resources/completions.mjs.map +1 -1
- package/dist/resources/conversations/conversations.d.ts +56 -12
- package/dist/resources/conversations/conversations.d.ts.map +1 -1
- package/dist/resources/conversations/conversations.js +0 -8
- package/dist/resources/conversations/conversations.js.map +1 -1
- package/dist/resources/conversations/conversations.mjs +0 -8
- package/dist/resources/conversations/conversations.mjs.map +1 -1
- package/dist/resources/conversations/items.d.ts +364 -81
- package/dist/resources/conversations/items.d.ts.map +1 -1
- package/dist/resources/conversations/items.js +0 -6
- package/dist/resources/conversations/items.js.map +1 -1
- package/dist/resources/conversations/items.mjs +0 -6
- package/dist/resources/conversations/items.mjs.map +1 -1
- package/dist/resources/embeddings.d.ts +46 -8
- package/dist/resources/embeddings.d.ts.map +1 -1
- package/dist/resources/embeddings.js +0 -2
- package/dist/resources/embeddings.js.map +1 -1
- package/dist/resources/embeddings.mjs +0 -2
- package/dist/resources/embeddings.mjs.map +1 -1
- package/dist/resources/files.d.ts +58 -31
- package/dist/resources/files.d.ts.map +1 -1
- package/dist/resources/files.js +4 -16
- package/dist/resources/files.js.map +1 -1
- package/dist/resources/files.mjs +4 -16
- package/dist/resources/files.mjs.map +1 -1
- package/dist/resources/index.d.ts +3 -3
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js.map +1 -1
- package/dist/resources/index.mjs.map +1 -1
- package/dist/resources/inspect.d.ts +3 -45
- package/dist/resources/inspect.d.ts.map +1 -1
- package/dist/resources/inspect.js +0 -4
- package/dist/resources/inspect.js.map +1 -1
- package/dist/resources/inspect.mjs +0 -4
- package/dist/resources/inspect.mjs.map +1 -1
- package/dist/resources/models/models.d.ts +21 -6
- package/dist/resources/models/models.d.ts.map +1 -1
- package/dist/resources/models/models.js +0 -6
- package/dist/resources/models/models.js.map +1 -1
- package/dist/resources/models/models.mjs +0 -6
- package/dist/resources/models/models.mjs.map +1 -1
- package/dist/resources/moderations.d.ts +38 -5
- package/dist/resources/moderations.d.ts.map +1 -1
- package/dist/resources/moderations.js +1 -3
- package/dist/resources/moderations.js.map +1 -1
- package/dist/resources/moderations.mjs +1 -3
- package/dist/resources/moderations.mjs.map +1 -1
- package/dist/resources/prompts/prompts.d.ts +24 -10
- package/dist/resources/prompts/prompts.d.ts.map +1 -1
- package/dist/resources/prompts/prompts.js +2 -10
- package/dist/resources/prompts/prompts.js.map +1 -1
- package/dist/resources/prompts/prompts.mjs +2 -10
- package/dist/resources/prompts/prompts.mjs.map +1 -1
- package/dist/resources/prompts/versions.d.ts +0 -2
- package/dist/resources/prompts/versions.d.ts.map +1 -1
- package/dist/resources/prompts/versions.js +0 -2
- package/dist/resources/prompts/versions.js.map +1 -1
- package/dist/resources/prompts/versions.mjs +0 -2
- package/dist/resources/prompts/versions.mjs.map +1 -1
- package/dist/resources/providers.d.ts +5 -12
- package/dist/resources/providers.d.ts.map +1 -1
- package/dist/resources/providers.js +0 -4
- package/dist/resources/providers.js.map +1 -1
- package/dist/resources/providers.mjs +0 -4
- package/dist/resources/providers.mjs.map +1 -1
- package/dist/resources/responses/input-items.d.ts +108 -9
- package/dist/resources/responses/input-items.d.ts.map +1 -1
- package/dist/resources/responses/responses.d.ts +881 -124
- package/dist/resources/responses/responses.d.ts.map +1 -1
- package/dist/resources/responses/responses.js.map +1 -1
- package/dist/resources/responses/responses.mjs.map +1 -1
- package/dist/resources/routes.d.ts +10 -9
- package/dist/resources/routes.d.ts.map +1 -1
- package/dist/resources/routes.js.map +1 -1
- package/dist/resources/routes.mjs.map +1 -1
- package/dist/resources/safety.d.ts +131 -9
- package/dist/resources/safety.d.ts.map +1 -1
- package/dist/resources/safety.js +1 -3
- package/dist/resources/safety.js.map +1 -1
- package/dist/resources/safety.mjs +1 -3
- package/dist/resources/safety.mjs.map +1 -1
- package/dist/resources/scoring-functions.d.ts +23 -1
- package/dist/resources/scoring-functions.d.ts.map +1 -1
- package/dist/resources/scoring.d.ts +24 -0
- package/dist/resources/scoring.d.ts.map +1 -1
- package/dist/resources/shared.d.ts +139 -7
- package/dist/resources/shared.d.ts.map +1 -1
- package/dist/resources/shields.d.ts +21 -0
- package/dist/resources/shields.d.ts.map +1 -1
- package/dist/resources/vector-io.d.ts +75 -58
- package/dist/resources/vector-io.d.ts.map +1 -1
- package/dist/resources/vector-io.js +1 -1
- package/dist/resources/vector-io.mjs +1 -1
- package/dist/resources/vector-stores/file-batches.d.ts +13 -7
- package/dist/resources/vector-stores/file-batches.d.ts.map +1 -1
- package/dist/resources/vector-stores/file-batches.js +3 -6
- package/dist/resources/vector-stores/file-batches.js.map +1 -1
- package/dist/resources/vector-stores/file-batches.mjs +3 -6
- package/dist/resources/vector-stores/file-batches.mjs.map +1 -1
- package/dist/resources/vector-stores/files.d.ts +31 -9
- package/dist/resources/vector-stores/files.d.ts.map +1 -1
- package/dist/resources/vector-stores/files.js +4 -4
- package/dist/resources/vector-stores/files.js.map +1 -1
- package/dist/resources/vector-stores/files.mjs +4 -4
- package/dist/resources/vector-stores/files.mjs.map +1 -1
- package/dist/resources/vector-stores/vector-stores.d.ts +87 -13
- package/dist/resources/vector-stores/vector-stores.d.ts.map +1 -1
- package/dist/resources/vector-stores/vector-stores.js +5 -10
- package/dist/resources/vector-stores/vector-stores.js.map +1 -1
- package/dist/resources/vector-stores/vector-stores.mjs +5 -10
- package/dist/resources/vector-stores/vector-stores.mjs.map +1 -1
- package/dist/src/core.ts +6 -0
- package/dist/src/index.ts +11 -16
- package/dist/src/resources/alpha/admin.ts +84 -0
- package/dist/src/resources/alpha/alpha.ts +16 -8
- package/dist/src/resources/alpha/benchmarks.ts +37 -1
- package/dist/src/resources/alpha/eval/eval.ts +28 -7
- package/dist/src/resources/alpha/index.ts +2 -0
- package/dist/src/resources/alpha/inference.ts +58 -7
- package/dist/src/resources/alpha/post-training/index.ts +2 -10
- package/dist/src/resources/alpha/post-training/job.ts +5 -26
- package/dist/src/resources/alpha/post-training/post-training.ts +38 -22
- package/dist/src/resources/beta/datasets.ts +103 -8
- package/dist/src/resources/chat/chat.ts +122 -20
- package/dist/src/resources/chat/completions.ts +1138 -79
- package/dist/src/resources/completions.ts +137 -28
- package/dist/src/resources/conversations/conversations.ts +67 -15
- package/dist/src/resources/conversations/items.ts +479 -110
- package/dist/src/resources/embeddings.ts +46 -8
- package/dist/src/resources/files.ts +58 -31
- package/dist/src/resources/index.ts +3 -3
- package/dist/src/resources/inspect.ts +3 -57
- package/dist/src/resources/models/models.ts +21 -6
- package/dist/src/resources/moderations.ts +38 -5
- package/dist/src/resources/prompts/prompts.ts +26 -12
- package/dist/src/resources/prompts/versions.ts +0 -2
- package/dist/src/resources/providers.ts +5 -16
- package/dist/src/resources/responses/input-items.ts +138 -15
- package/dist/src/resources/responses/responses.ts +1076 -196
- package/dist/src/resources/routes.ts +10 -14
- package/dist/src/resources/safety.ts +131 -8
- package/dist/src/resources/scoring-functions.ts +23 -1
- package/dist/src/resources/scoring.ts +24 -0
- package/dist/src/resources/shared.ts +148 -7
- package/dist/src/resources/shields.ts +21 -0
- package/dist/src/resources/vector-io.ts +95 -78
- package/dist/src/resources/vector-stores/file-batches.ts +13 -7
- package/dist/src/resources/vector-stores/files.ts +31 -11
- package/dist/src/resources/vector-stores/vector-stores.ts +89 -15
- package/dist/src/version.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +1 -1
- package/src/core.ts +6 -0
- package/src/index.ts +11 -16
- package/src/resources/alpha/admin.ts +84 -0
- package/src/resources/alpha/alpha.ts +16 -8
- package/src/resources/alpha/benchmarks.ts +37 -1
- package/src/resources/alpha/eval/eval.ts +28 -7
- package/src/resources/alpha/index.ts +2 -0
- package/src/resources/alpha/inference.ts +58 -7
- package/src/resources/alpha/post-training/index.ts +2 -10
- package/src/resources/alpha/post-training/job.ts +5 -26
- package/src/resources/alpha/post-training/post-training.ts +38 -22
- package/src/resources/beta/datasets.ts +103 -8
- package/src/resources/chat/chat.ts +122 -20
- package/src/resources/chat/completions.ts +1138 -79
- package/src/resources/completions.ts +137 -28
- package/src/resources/conversations/conversations.ts +67 -15
- package/src/resources/conversations/items.ts +479 -110
- package/src/resources/embeddings.ts +46 -8
- package/src/resources/files.ts +58 -31
- package/src/resources/index.ts +3 -3
- package/src/resources/inspect.ts +3 -57
- package/src/resources/models/models.ts +21 -6
- package/src/resources/moderations.ts +38 -5
- package/src/resources/prompts/prompts.ts +26 -12
- package/src/resources/prompts/versions.ts +0 -2
- package/src/resources/providers.ts +5 -16
- package/src/resources/responses/input-items.ts +138 -15
- package/src/resources/responses/responses.ts +1076 -196
- package/src/resources/routes.ts +10 -14
- package/src/resources/safety.ts +131 -8
- package/src/resources/scoring-functions.ts +23 -1
- package/src/resources/scoring.ts +24 -0
- package/src/resources/shared.ts +148 -7
- package/src/resources/shields.ts +21 -0
- package/src/resources/vector-io.ts +95 -78
- package/src/resources/vector-stores/file-batches.ts +13 -7
- package/src/resources/vector-stores/files.ts +31 -11
- package/src/resources/vector-stores/vector-stores.ts +89 -15
- package/src/version.ts +1 -1
- package/tests/api-resources/alpha/admin.test.ts +111 -0
- package/tests/api-resources/alpha/eval/eval.test.ts +40 -20
- package/tests/api-resources/alpha/inference.test.ts +1 -1
- package/tests/api-resources/alpha/post-training/job.test.ts +21 -12
- package/tests/api-resources/alpha/post-training/post-training.test.ts +12 -2
- package/tests/api-resources/beta/datasets.test.ts +9 -3
- package/tests/api-resources/chat/completions.test.ts +20 -7
- package/tests/api-resources/completions.test.ts +5 -5
- package/tests/api-resources/conversations/items.test.ts +22 -3
- package/tests/api-resources/embeddings.test.ts +2 -2
- package/tests/api-resources/files.test.ts +6 -1
- package/tests/api-resources/responses/input-items.test.ts +7 -1
- package/tests/api-resources/responses/responses.test.ts +19 -5
- package/tests/api-resources/safety.test.ts +9 -5
- package/tests/api-resources/tool-runtime.test.ts +9 -2
- package/tests/api-resources/vector-io.test.ts +13 -4
- package/tests/api-resources/vector-stores/file-batches.test.ts +7 -1
- package/tests/api-resources/vector-stores/files.test.ts +7 -1
- package/tests/api-resources/vector-stores/vector-stores.test.ts +14 -2
|
@@ -9,12 +9,10 @@
|
|
|
9
9
|
import { APIResource } from '../resource';
|
|
10
10
|
import { isRequestOptions } from '../core';
|
|
11
11
|
import * as Core from '../core';
|
|
12
|
-
import * as
|
|
12
|
+
import * as Shared from './shared';
|
|
13
13
|
|
|
14
14
|
export class Routes extends APIResource {
|
|
15
15
|
/**
|
|
16
|
-
* List routes.
|
|
17
|
-
*
|
|
18
16
|
* List all available API routes with their methods and implementing providers.
|
|
19
17
|
*/
|
|
20
18
|
list(query?: RouteListParams, options?: Core.RequestOptions): Core.APIPromise<RouteListResponse>;
|
|
@@ -35,22 +33,20 @@ export class Routes extends APIResource {
|
|
|
35
33
|
}
|
|
36
34
|
|
|
37
35
|
/**
|
|
38
|
-
*
|
|
36
|
+
* List of available API routes
|
|
39
37
|
*/
|
|
40
|
-
export
|
|
41
|
-
data: RouteListResponse;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export type RouteListResponse = Array<InspectAPI.RouteInfo>;
|
|
38
|
+
export type RouteListResponse = Array<Shared.RouteInfo>;
|
|
45
39
|
|
|
46
40
|
export interface RouteListParams {
|
|
41
|
+
/**
|
|
42
|
+
* Optional filter to control which routes are returned. Can be an API level ('v1',
|
|
43
|
+
* 'v1alpha', 'v1beta') to show non-deprecated routes at that level, or
|
|
44
|
+
* 'deprecated' to show deprecated routes across all levels. If not specified,
|
|
45
|
+
* returns all non-deprecated routes.
|
|
46
|
+
*/
|
|
47
47
|
api_filter?: 'v1' | 'v1alpha' | 'v1beta' | 'deprecated' | null;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
export declare namespace Routes {
|
|
51
|
-
export {
|
|
52
|
-
type ListRoutesResponse as ListRoutesResponse,
|
|
53
|
-
type RouteListResponse as RouteListResponse,
|
|
54
|
-
type RouteListParams as RouteListParams,
|
|
55
|
-
};
|
|
51
|
+
export { type RouteListResponse as RouteListResponse, type RouteListParams as RouteListParams };
|
|
56
52
|
}
|
|
@@ -12,9 +12,7 @@ import * as Shared from './shared';
|
|
|
12
12
|
|
|
13
13
|
export class Safety extends APIResource {
|
|
14
14
|
/**
|
|
15
|
-
* Run shield.
|
|
16
|
-
*
|
|
17
|
-
* Run a shield.
|
|
15
|
+
* Run a safety shield on messages to check for policy violations.
|
|
18
16
|
*/
|
|
19
17
|
runShield(body: SafetyRunShieldParams, options?: Core.RequestOptions): Core.APIPromise<RunShieldResponse> {
|
|
20
18
|
return this._client.post('/v1/safety/run-shield', { body, ...options });
|
|
@@ -32,6 +30,9 @@ export interface RunShieldResponse {
|
|
|
32
30
|
}
|
|
33
31
|
|
|
34
32
|
export interface SafetyRunShieldParams {
|
|
33
|
+
/**
|
|
34
|
+
* The messages to run the shield on
|
|
35
|
+
*/
|
|
35
36
|
messages: Array<
|
|
36
37
|
| SafetyRunShieldParams.OpenAIUserMessageParamInput
|
|
37
38
|
| SafetyRunShieldParams.OpenAISystemMessageParam
|
|
@@ -40,8 +41,9 @@ export interface SafetyRunShieldParams {
|
|
|
40
41
|
| SafetyRunShieldParams.OpenAIDeveloperMessageParam
|
|
41
42
|
>;
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
/**
|
|
45
|
+
* The identifier of the shield to run
|
|
46
|
+
*/
|
|
45
47
|
shield_id: string;
|
|
46
48
|
}
|
|
47
49
|
|
|
@@ -50,6 +52,9 @@ export namespace SafetyRunShieldParams {
|
|
|
50
52
|
* A message from the user in an OpenAI-compatible chat completion request.
|
|
51
53
|
*/
|
|
52
54
|
export interface OpenAIUserMessageParamInput {
|
|
55
|
+
/**
|
|
56
|
+
* The content of the message, which can include text and other media.
|
|
57
|
+
*/
|
|
53
58
|
content:
|
|
54
59
|
| string
|
|
55
60
|
| Array<
|
|
@@ -58,8 +63,14 @@ export namespace SafetyRunShieldParams {
|
|
|
58
63
|
| OpenAIUserMessageParamInput.OpenAIFile
|
|
59
64
|
>;
|
|
60
65
|
|
|
66
|
+
/**
|
|
67
|
+
* The name of the user message participant.
|
|
68
|
+
*/
|
|
61
69
|
name?: string | null;
|
|
62
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Must be 'user' to identify this as a user message.
|
|
73
|
+
*/
|
|
63
74
|
role?: 'user';
|
|
64
75
|
}
|
|
65
76
|
|
|
@@ -68,8 +79,14 @@ export namespace SafetyRunShieldParams {
|
|
|
68
79
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
69
80
|
*/
|
|
70
81
|
export interface OpenAIChatCompletionContentPartTextParam {
|
|
82
|
+
/**
|
|
83
|
+
* The text content of the message.
|
|
84
|
+
*/
|
|
71
85
|
text: string;
|
|
72
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Must be 'text' to identify this as text content.
|
|
89
|
+
*/
|
|
73
90
|
type?: 'text';
|
|
74
91
|
}
|
|
75
92
|
|
|
@@ -78,36 +95,63 @@ export namespace SafetyRunShieldParams {
|
|
|
78
95
|
*/
|
|
79
96
|
export interface OpenAIChatCompletionContentPartImageParam {
|
|
80
97
|
/**
|
|
81
|
-
* Image URL specification
|
|
98
|
+
* Image URL specification and processing details.
|
|
82
99
|
*/
|
|
83
100
|
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
84
101
|
|
|
102
|
+
/**
|
|
103
|
+
* Must be 'image_url' to identify this as image content.
|
|
104
|
+
*/
|
|
85
105
|
type?: 'image_url';
|
|
86
106
|
}
|
|
87
107
|
|
|
88
108
|
export namespace OpenAIChatCompletionContentPartImageParam {
|
|
89
109
|
/**
|
|
90
|
-
* Image URL specification
|
|
110
|
+
* Image URL specification and processing details.
|
|
91
111
|
*/
|
|
92
112
|
export interface ImageURL {
|
|
113
|
+
/**
|
|
114
|
+
* URL of the image to include in the message.
|
|
115
|
+
*/
|
|
93
116
|
url: string;
|
|
94
117
|
|
|
95
|
-
|
|
118
|
+
/**
|
|
119
|
+
* Level of detail for image processing. Can be 'low', 'high', or 'auto'.
|
|
120
|
+
*/
|
|
121
|
+
detail?: 'low' | 'high' | 'auto' | null;
|
|
96
122
|
}
|
|
97
123
|
}
|
|
98
124
|
|
|
99
125
|
export interface OpenAIFile {
|
|
126
|
+
/**
|
|
127
|
+
* File specification.
|
|
128
|
+
*/
|
|
100
129
|
file: OpenAIFile.File;
|
|
101
130
|
|
|
131
|
+
/**
|
|
132
|
+
* Must be 'file' to identify this as file content.
|
|
133
|
+
*/
|
|
102
134
|
type?: 'file';
|
|
103
135
|
}
|
|
104
136
|
|
|
105
137
|
export namespace OpenAIFile {
|
|
138
|
+
/**
|
|
139
|
+
* File specification.
|
|
140
|
+
*/
|
|
106
141
|
export interface File {
|
|
142
|
+
/**
|
|
143
|
+
* Base64-encoded file data.
|
|
144
|
+
*/
|
|
107
145
|
file_data?: string | null;
|
|
108
146
|
|
|
147
|
+
/**
|
|
148
|
+
* ID of an uploaded file.
|
|
149
|
+
*/
|
|
109
150
|
file_id?: string | null;
|
|
110
151
|
|
|
152
|
+
/**
|
|
153
|
+
* Name of the file.
|
|
154
|
+
*/
|
|
111
155
|
filename?: string | null;
|
|
112
156
|
}
|
|
113
157
|
}
|
|
@@ -117,10 +161,20 @@ export namespace SafetyRunShieldParams {
|
|
|
117
161
|
* A system message providing instructions or context to the model.
|
|
118
162
|
*/
|
|
119
163
|
export interface OpenAISystemMessageParam {
|
|
164
|
+
/**
|
|
165
|
+
* The content of the 'system prompt'. If multiple system messages are provided,
|
|
166
|
+
* they are concatenated.
|
|
167
|
+
*/
|
|
120
168
|
content: string | Array<OpenAISystemMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
121
169
|
|
|
170
|
+
/**
|
|
171
|
+
* The name of the system message participant.
|
|
172
|
+
*/
|
|
122
173
|
name?: string | null;
|
|
123
174
|
|
|
175
|
+
/**
|
|
176
|
+
* Must be 'system' to identify this as a system message.
|
|
177
|
+
*/
|
|
124
178
|
role?: 'system';
|
|
125
179
|
}
|
|
126
180
|
|
|
@@ -129,8 +183,14 @@ export namespace SafetyRunShieldParams {
|
|
|
129
183
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
130
184
|
*/
|
|
131
185
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
186
|
+
/**
|
|
187
|
+
* The text content of the message.
|
|
188
|
+
*/
|
|
132
189
|
text: string;
|
|
133
190
|
|
|
191
|
+
/**
|
|
192
|
+
* Must be 'text' to identify this as text content.
|
|
193
|
+
*/
|
|
134
194
|
type?: 'text';
|
|
135
195
|
}
|
|
136
196
|
}
|
|
@@ -140,15 +200,27 @@ export namespace SafetyRunShieldParams {
|
|
|
140
200
|
* chat completion request.
|
|
141
201
|
*/
|
|
142
202
|
export interface OpenAIAssistantMessageParamInput {
|
|
203
|
+
/**
|
|
204
|
+
* The content of the model's response.
|
|
205
|
+
*/
|
|
143
206
|
content?:
|
|
144
207
|
| string
|
|
145
208
|
| Array<OpenAIAssistantMessageParamInput.ListOpenAIChatCompletionContentPartTextParam>
|
|
146
209
|
| null;
|
|
147
210
|
|
|
211
|
+
/**
|
|
212
|
+
* The name of the assistant message participant.
|
|
213
|
+
*/
|
|
148
214
|
name?: string | null;
|
|
149
215
|
|
|
216
|
+
/**
|
|
217
|
+
* Must be 'assistant' to identify this as the model's response.
|
|
218
|
+
*/
|
|
150
219
|
role?: 'assistant';
|
|
151
220
|
|
|
221
|
+
/**
|
|
222
|
+
* List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
|
|
223
|
+
*/
|
|
152
224
|
tool_calls?: Array<OpenAIAssistantMessageParamInput.ToolCall> | null;
|
|
153
225
|
}
|
|
154
226
|
|
|
@@ -157,8 +229,14 @@ export namespace SafetyRunShieldParams {
|
|
|
157
229
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
158
230
|
*/
|
|
159
231
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
232
|
+
/**
|
|
233
|
+
* The text content of the message.
|
|
234
|
+
*/
|
|
160
235
|
text: string;
|
|
161
236
|
|
|
237
|
+
/**
|
|
238
|
+
* Must be 'text' to identify this as text content.
|
|
239
|
+
*/
|
|
162
240
|
type?: 'text';
|
|
163
241
|
}
|
|
164
242
|
|
|
@@ -166,6 +244,9 @@ export namespace SafetyRunShieldParams {
|
|
|
166
244
|
* Tool call specification for OpenAI-compatible chat completion responses.
|
|
167
245
|
*/
|
|
168
246
|
export interface ToolCall {
|
|
247
|
+
/**
|
|
248
|
+
* Unique identifier for the tool call.
|
|
249
|
+
*/
|
|
169
250
|
id?: string | null;
|
|
170
251
|
|
|
171
252
|
/**
|
|
@@ -173,8 +254,14 @@ export namespace SafetyRunShieldParams {
|
|
|
173
254
|
*/
|
|
174
255
|
function?: ToolCall.Function | null;
|
|
175
256
|
|
|
257
|
+
/**
|
|
258
|
+
* Index of the tool call in the list.
|
|
259
|
+
*/
|
|
176
260
|
index?: number | null;
|
|
177
261
|
|
|
262
|
+
/**
|
|
263
|
+
* Must be 'function' to identify this as a function call.
|
|
264
|
+
*/
|
|
178
265
|
type?: 'function';
|
|
179
266
|
}
|
|
180
267
|
|
|
@@ -183,8 +270,14 @@ export namespace SafetyRunShieldParams {
|
|
|
183
270
|
* Function call details for OpenAI-compatible tool calls.
|
|
184
271
|
*/
|
|
185
272
|
export interface Function {
|
|
273
|
+
/**
|
|
274
|
+
* Arguments to pass to the function as a JSON string.
|
|
275
|
+
*/
|
|
186
276
|
arguments?: string | null;
|
|
187
277
|
|
|
278
|
+
/**
|
|
279
|
+
* Name of the function to call.
|
|
280
|
+
*/
|
|
188
281
|
name?: string | null;
|
|
189
282
|
}
|
|
190
283
|
}
|
|
@@ -195,10 +288,19 @@ export namespace SafetyRunShieldParams {
|
|
|
195
288
|
* chat completion request.
|
|
196
289
|
*/
|
|
197
290
|
export interface OpenAIToolMessageParam {
|
|
291
|
+
/**
|
|
292
|
+
* The response content from the tool.
|
|
293
|
+
*/
|
|
198
294
|
content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
199
295
|
|
|
296
|
+
/**
|
|
297
|
+
* Unique identifier for the tool call this response is for.
|
|
298
|
+
*/
|
|
200
299
|
tool_call_id: string;
|
|
201
300
|
|
|
301
|
+
/**
|
|
302
|
+
* Must be 'tool' to identify this as a tool response.
|
|
303
|
+
*/
|
|
202
304
|
role?: 'tool';
|
|
203
305
|
}
|
|
204
306
|
|
|
@@ -207,8 +309,14 @@ export namespace SafetyRunShieldParams {
|
|
|
207
309
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
208
310
|
*/
|
|
209
311
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
312
|
+
/**
|
|
313
|
+
* The text content of the message.
|
|
314
|
+
*/
|
|
210
315
|
text: string;
|
|
211
316
|
|
|
317
|
+
/**
|
|
318
|
+
* Must be 'text' to identify this as text content.
|
|
319
|
+
*/
|
|
212
320
|
type?: 'text';
|
|
213
321
|
}
|
|
214
322
|
}
|
|
@@ -217,10 +325,19 @@ export namespace SafetyRunShieldParams {
|
|
|
217
325
|
* A message from the developer in an OpenAI-compatible chat completion request.
|
|
218
326
|
*/
|
|
219
327
|
export interface OpenAIDeveloperMessageParam {
|
|
328
|
+
/**
|
|
329
|
+
* The content of the developer message.
|
|
330
|
+
*/
|
|
220
331
|
content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
221
332
|
|
|
333
|
+
/**
|
|
334
|
+
* The name of the developer message participant.
|
|
335
|
+
*/
|
|
222
336
|
name?: string | null;
|
|
223
337
|
|
|
338
|
+
/**
|
|
339
|
+
* Must be 'developer' to identify this as a developer message.
|
|
340
|
+
*/
|
|
224
341
|
role?: 'developer';
|
|
225
342
|
}
|
|
226
343
|
|
|
@@ -229,8 +346,14 @@ export namespace SafetyRunShieldParams {
|
|
|
229
346
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
230
347
|
*/
|
|
231
348
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
349
|
+
/**
|
|
350
|
+
* The text content of the message.
|
|
351
|
+
*/
|
|
232
352
|
text: string;
|
|
233
353
|
|
|
354
|
+
/**
|
|
355
|
+
* Must be 'text' to identify this as text content.
|
|
356
|
+
*/
|
|
234
357
|
type?: 'text';
|
|
235
358
|
}
|
|
236
359
|
}
|
|
@@ -54,7 +54,13 @@ export class ScoringFunctions extends APIResource {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Response containing a list of scoring function objects.
|
|
59
|
+
*/
|
|
57
60
|
export interface ListScoringFunctionsResponse {
|
|
61
|
+
/**
|
|
62
|
+
* List of scoring function objects.
|
|
63
|
+
*/
|
|
58
64
|
data: ScoringFunctionListResponse;
|
|
59
65
|
}
|
|
60
66
|
|
|
@@ -237,17 +243,27 @@ export namespace ScoringFnParams {
|
|
|
237
243
|
}
|
|
238
244
|
}
|
|
239
245
|
|
|
246
|
+
/**
|
|
247
|
+
* List of scoring function objects.
|
|
248
|
+
*/
|
|
240
249
|
export type ScoringFunctionListResponse = Array<ScoringFn>;
|
|
241
250
|
|
|
242
251
|
export interface ScoringFunctionRegisterParams {
|
|
252
|
+
/**
|
|
253
|
+
* The description of the scoring function.
|
|
254
|
+
*/
|
|
243
255
|
description: string;
|
|
244
256
|
|
|
245
257
|
return_type: ScoringFunctionRegisterParams.ReturnType;
|
|
246
258
|
|
|
259
|
+
/**
|
|
260
|
+
* The ID of the scoring function to register.
|
|
261
|
+
*/
|
|
247
262
|
scoring_fn_id: string;
|
|
248
263
|
|
|
249
264
|
/**
|
|
250
|
-
*
|
|
265
|
+
* The parameters for the scoring function for benchmark eval, these can be
|
|
266
|
+
* overridden for app eval.
|
|
251
267
|
*/
|
|
252
268
|
params?:
|
|
253
269
|
| ScoringFunctionRegisterParams.LlmAsJudgeScoringFnParams
|
|
@@ -255,8 +271,14 @@ export interface ScoringFunctionRegisterParams {
|
|
|
255
271
|
| ScoringFunctionRegisterParams.BasicScoringFnParams
|
|
256
272
|
| null;
|
|
257
273
|
|
|
274
|
+
/**
|
|
275
|
+
* The ID of the provider to use for the scoring function.
|
|
276
|
+
*/
|
|
258
277
|
provider_id?: string | null;
|
|
259
278
|
|
|
279
|
+
/**
|
|
280
|
+
* The ID of the provider scoring function to use for the scoring function.
|
|
281
|
+
*/
|
|
260
282
|
provider_scoring_fn_id?: string | null;
|
|
261
283
|
}
|
|
262
284
|
|
|
@@ -33,6 +33,9 @@ export class Scoring extends APIResource {
|
|
|
33
33
|
* The response from scoring.
|
|
34
34
|
*/
|
|
35
35
|
export interface ScoringScoreResponse {
|
|
36
|
+
/**
|
|
37
|
+
* A map of scoring function name to ScoringResult.
|
|
38
|
+
*/
|
|
36
39
|
results: { [key: string]: Shared.ScoringResult };
|
|
37
40
|
}
|
|
38
41
|
|
|
@@ -40,14 +43,26 @@ export interface ScoringScoreResponse {
|
|
|
40
43
|
* Response from batch scoring operations on datasets.
|
|
41
44
|
*/
|
|
42
45
|
export interface ScoringScoreBatchResponse {
|
|
46
|
+
/**
|
|
47
|
+
* A map of scoring function name to ScoringResult
|
|
48
|
+
*/
|
|
43
49
|
results: { [key: string]: Shared.ScoringResult };
|
|
44
50
|
|
|
51
|
+
/**
|
|
52
|
+
* (Optional) The identifier of the dataset that was scored
|
|
53
|
+
*/
|
|
45
54
|
dataset_id?: string | null;
|
|
46
55
|
}
|
|
47
56
|
|
|
48
57
|
export interface ScoringScoreParams {
|
|
58
|
+
/**
|
|
59
|
+
* The rows to score.
|
|
60
|
+
*/
|
|
49
61
|
input_rows: Array<{ [key: string]: unknown }>;
|
|
50
62
|
|
|
63
|
+
/**
|
|
64
|
+
* The scoring functions to use for the scoring.
|
|
65
|
+
*/
|
|
51
66
|
scoring_functions: {
|
|
52
67
|
[key: string]:
|
|
53
68
|
| ScoringScoreParams.LlmAsJudgeScoringFnParams
|
|
@@ -116,8 +131,14 @@ export namespace ScoringScoreParams {
|
|
|
116
131
|
}
|
|
117
132
|
|
|
118
133
|
export interface ScoringScoreBatchParams {
|
|
134
|
+
/**
|
|
135
|
+
* The ID of the dataset to score.
|
|
136
|
+
*/
|
|
119
137
|
dataset_id: string;
|
|
120
138
|
|
|
139
|
+
/**
|
|
140
|
+
* The scoring functions to use for the scoring.
|
|
141
|
+
*/
|
|
121
142
|
scoring_functions: {
|
|
122
143
|
[key: string]:
|
|
123
144
|
| ScoringScoreBatchParams.LlmAsJudgeScoringFnParams
|
|
@@ -126,6 +147,9 @@ export interface ScoringScoreBatchParams {
|
|
|
126
147
|
| null;
|
|
127
148
|
};
|
|
128
149
|
|
|
150
|
+
/**
|
|
151
|
+
* Whether to save the results to a dataset.
|
|
152
|
+
*/
|
|
129
153
|
save_results_dataset?: boolean;
|
|
130
154
|
}
|
|
131
155
|
|