@@ -5,13 +5,6 @@ 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
-
15
8
/**
16
9
* Run a shield.
17
10
*/
@@ -20,61 +13,6 @@ export class Safety extends APIResource {
20
13
}
21
14
}
22
15
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. Required
67
- * set of categories that need to be in response - violence - violence/graphic -
68
- * harassment - harassment/threatening - hate - hate/threatening - illicit -
69
- * illicit/violent - sexual - sexual/minors - self-harm - self-harm/intent -
70
- * self-harm/instructions
71
- */
72
- category_scores ?: { [ key : string ] : number } ;
73
-
74
- user_message ?: string ;
75
- }
76
- }
77
-
78
16
/**
79
17
* Response from running a safety shield.
80
18
*/
@@ -85,19 +23,6 @@ export interface RunShieldResponse {
85
23
violation ?: Shared . SafetyViolation ;
86
24
}
87
25
88
- export interface SafetyCreateParams {
89
- /**
90
- * Input (or inputs) to classify. Can be a single string, an array of strings, or
91
- * an array of multi-modal input objects similar to other models.
92
- */
93
- input : string | Array < string > ;
94
-
95
- /**
96
- * The content moderation model you would like to use.
97
- */
98
- model : string ;
99
- }
100
-
101
26
export interface SafetyRunShieldParams {
102
27
/**
103
28
* The messages to run the shield on.
@@ -116,10 +41,5 @@ export interface SafetyRunShieldParams {
116
41
}
117
42
118
43
export declare namespace Safety {
119
- export {
120
- type CreateResponse as CreateResponse ,
121
- type RunShieldResponse as RunShieldResponse ,
122
- type SafetyCreateParams as SafetyCreateParams ,
123
- type SafetyRunShieldParams as SafetyRunShieldParams ,
124
- } ;
44
+ export { type RunShieldResponse as RunShieldResponse , type SafetyRunShieldParams as SafetyRunShieldParams } ;
125
45
}
0 commit comments