@uipath/apollo-react 6.48.0 → 6.49.0
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/dist/canvas/components/Guardrails/__fixtures__/catalog-coverage.cjs +83 -0
- package/dist/canvas/components/Guardrails/__fixtures__/catalog-coverage.d.ts +8 -0
- package/dist/canvas/components/Guardrails/__fixtures__/catalog-coverage.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/__fixtures__/catalog-coverage.js +37 -0
- package/dist/canvas/components/Guardrails/__fixtures__/definitions-wire.fixtures.cjs +344 -0
- package/dist/canvas/components/Guardrails/__fixtures__/definitions-wire.fixtures.d.ts +13 -0
- package/dist/canvas/components/Guardrails/__fixtures__/definitions-wire.fixtures.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/__fixtures__/definitions-wire.fixtures.js +280 -0
- package/dist/canvas/components/Guardrails/__fixtures__/host-copy-baselines.cjs +221 -0
- package/dist/canvas/components/Guardrails/__fixtures__/host-copy-baselines.d.ts +4 -0
- package/dist/canvas/components/Guardrails/__fixtures__/host-copy-baselines.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/__fixtures__/host-copy-baselines.js +184 -0
- package/dist/canvas/components/Guardrails/builder-types.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/components/guardrail-chip.cjs +5 -1
- package/dist/canvas/components/Guardrails/components/guardrail-chip.d.ts +1 -0
- package/dist/canvas/components/Guardrails/components/guardrail-chip.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/components/guardrail-chip.js +3 -2
- package/dist/canvas/components/Guardrails/components/guardrail-status-chip.cjs +60 -0
- package/dist/canvas/components/Guardrails/components/guardrail-status-chip.d.ts +7 -0
- package/dist/canvas/components/Guardrails/components/guardrail-status-chip.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/components/guardrail-status-chip.js +26 -0
- package/dist/canvas/components/Guardrails/definitions-copy.cjs +369 -0
- package/dist/canvas/components/Guardrails/definitions-copy.d.ts +14 -0
- package/dist/canvas/components/Guardrails/definitions-copy.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/definitions-copy.js +326 -0
- package/dist/canvas/components/Guardrails/definitions-enrich.cjs +173 -0
- package/dist/canvas/components/Guardrails/definitions-enrich.d.ts +30 -0
- package/dist/canvas/components/Guardrails/definitions-enrich.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/definitions-enrich.js +130 -0
- package/dist/canvas/components/Guardrails/definitions-parse.cjs +199 -0
- package/dist/canvas/components/Guardrails/definitions-parse.d.ts +13 -0
- package/dist/canvas/components/Guardrails/definitions-parse.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/definitions-parse.js +165 -0
- package/dist/canvas/components/Guardrails/definitions-wire.cjs +18 -0
- package/dist/canvas/components/Guardrails/definitions-wire.d.ts +59 -0
- package/dist/canvas/components/Guardrails/definitions-wire.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/definitions-wire.js +0 -0
- package/dist/canvas/components/Guardrails/i18n.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/index.cjs +49 -8
- package/dist/canvas/components/Guardrails/index.d.ts +11 -0
- package/dist/canvas/components/Guardrails/index.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/index.js +6 -1
- package/dist/canvas/components/Guardrails/types.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/use-guardrail-definitions.cjs +158 -0
- package/dist/canvas/components/Guardrails/use-guardrail-definitions.d.ts +30 -0
- package/dist/canvas/components/Guardrails/use-guardrail-definitions.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/use-guardrail-definitions.js +121 -0
- package/dist/canvas/locales/en.cjs +1 -1
- package/dist/canvas/locales/en.d.ts.map +1 -1
- package/dist/canvas/locales/en.js +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
|
|
3
|
+
return "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
|
|
4
|
+
}();
|
|
5
|
+
var __webpack_require__ = {};
|
|
6
|
+
(()=>{
|
|
7
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
8
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: definition[key]
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
16
|
+
})();
|
|
17
|
+
(()=>{
|
|
18
|
+
__webpack_require__.r = (exports1)=>{
|
|
19
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
20
|
+
value: 'Module'
|
|
21
|
+
});
|
|
22
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
23
|
+
value: true
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
})();
|
|
27
|
+
var __webpack_exports__ = {};
|
|
28
|
+
__webpack_require__.r(__webpack_exports__);
|
|
29
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
30
|
+
findCatalogDrift: ()=>findCatalogDrift,
|
|
31
|
+
readCanvasCatalog: ()=>readCanvasCatalog,
|
|
32
|
+
findCatalogOrphans: ()=>findCatalogOrphans,
|
|
33
|
+
CANVAS_LOCALES: ()=>CANVAS_LOCALES
|
|
34
|
+
});
|
|
35
|
+
const external_node_fs_namespaceObject = require("node:fs");
|
|
36
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
37
|
+
const external_node_url_namespaceObject = require("node:url");
|
|
38
|
+
const CANVAS_LOCALES = [
|
|
39
|
+
'en',
|
|
40
|
+
'ru',
|
|
41
|
+
'de',
|
|
42
|
+
'es',
|
|
43
|
+
'es-MX',
|
|
44
|
+
'fr',
|
|
45
|
+
'ja',
|
|
46
|
+
'ko',
|
|
47
|
+
'pt',
|
|
48
|
+
'pt-BR',
|
|
49
|
+
'ro',
|
|
50
|
+
'tr',
|
|
51
|
+
'zh-CN',
|
|
52
|
+
'zh-TW'
|
|
53
|
+
];
|
|
54
|
+
const localesDir = (0, external_node_path_namespaceObject.join)((0, external_node_path_namespaceObject.dirname)((0, external_node_url_namespaceObject.fileURLToPath)(__rslib_import_meta_url__)), '../../../locales');
|
|
55
|
+
const readCanvasCatalog = (locale)=>JSON.parse((0, external_node_fs_namespaceObject.readFileSync)((0, external_node_path_namespaceObject.join)(localesDir, `${locale}.json`), 'utf8'));
|
|
56
|
+
function findCatalogDrift(messages) {
|
|
57
|
+
const catalog = readCanvasCatalog('en');
|
|
58
|
+
const missing = [];
|
|
59
|
+
const drifted = [];
|
|
60
|
+
for (const [id, message] of Object.entries(messages))if (id in catalog) {
|
|
61
|
+
if (catalog[id] !== message) drifted.push(`${id}\n src: ${message}\n en: ${catalog[id]}`);
|
|
62
|
+
} else missing.push(id);
|
|
63
|
+
return {
|
|
64
|
+
missing,
|
|
65
|
+
drifted
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function findCatalogOrphans(messages, prefix) {
|
|
69
|
+
return CANVAS_LOCALES.flatMap((locale)=>Object.keys(readCanvasCatalog(locale)).filter((id)=>id.startsWith(prefix)).filter((id)=>!(id in messages)).map((id)=>`${locale}: ${id}`));
|
|
70
|
+
}
|
|
71
|
+
exports.CANVAS_LOCALES = __webpack_exports__.CANVAS_LOCALES;
|
|
72
|
+
exports.findCatalogDrift = __webpack_exports__.findCatalogDrift;
|
|
73
|
+
exports.findCatalogOrphans = __webpack_exports__.findCatalogOrphans;
|
|
74
|
+
exports.readCanvasCatalog = __webpack_exports__.readCanvasCatalog;
|
|
75
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
76
|
+
"CANVAS_LOCALES",
|
|
77
|
+
"findCatalogDrift",
|
|
78
|
+
"findCatalogOrphans",
|
|
79
|
+
"readCanvasCatalog"
|
|
80
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
81
|
+
Object.defineProperty(exports, '__esModule', {
|
|
82
|
+
value: true
|
|
83
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const CANVAS_LOCALES: string[];
|
|
2
|
+
export declare const readCanvasCatalog: (locale: string) => Record<string, string>;
|
|
3
|
+
export declare function findCatalogDrift(messages: Readonly<Record<string, string>>): {
|
|
4
|
+
missing: string[];
|
|
5
|
+
drifted: string[];
|
|
6
|
+
};
|
|
7
|
+
export declare function findCatalogOrphans(messages: Readonly<Record<string, string>>, prefix: string): string[];
|
|
8
|
+
//# sourceMappingURL=catalog-coverage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-coverage.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/__fixtures__/catalog-coverage.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,cAAc,UAe1B,CAAC;AAIF,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CACF,CAAC;AAOvE,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG;IAC5E,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAWA;AAOD,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAC1C,MAAM,EAAE,MAAM,GACb,MAAM,EAAE,CAOV"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
const CANVAS_LOCALES = [
|
|
5
|
+
'en',
|
|
6
|
+
'ru',
|
|
7
|
+
'de',
|
|
8
|
+
'es',
|
|
9
|
+
'es-MX',
|
|
10
|
+
'fr',
|
|
11
|
+
'ja',
|
|
12
|
+
'ko',
|
|
13
|
+
'pt',
|
|
14
|
+
'pt-BR',
|
|
15
|
+
'ro',
|
|
16
|
+
'tr',
|
|
17
|
+
'zh-CN',
|
|
18
|
+
'zh-TW'
|
|
19
|
+
];
|
|
20
|
+
const localesDir = join(dirname(fileURLToPath(import.meta.url)), '../../../locales');
|
|
21
|
+
const readCanvasCatalog = (locale)=>JSON.parse(readFileSync(join(localesDir, `${locale}.json`), 'utf8'));
|
|
22
|
+
function findCatalogDrift(messages) {
|
|
23
|
+
const catalog = readCanvasCatalog('en');
|
|
24
|
+
const missing = [];
|
|
25
|
+
const drifted = [];
|
|
26
|
+
for (const [id, message] of Object.entries(messages))if (id in catalog) {
|
|
27
|
+
if (catalog[id] !== message) drifted.push(`${id}\n src: ${message}\n en: ${catalog[id]}`);
|
|
28
|
+
} else missing.push(id);
|
|
29
|
+
return {
|
|
30
|
+
missing,
|
|
31
|
+
drifted
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function findCatalogOrphans(messages, prefix) {
|
|
35
|
+
return CANVAS_LOCALES.flatMap((locale)=>Object.keys(readCanvasCatalog(locale)).filter((id)=>id.startsWith(prefix)).filter((id)=>!(id in messages)).map((id)=>`${locale}: ${id}`));
|
|
36
|
+
}
|
|
37
|
+
export { CANVAS_LOCALES, findCatalogDrift, findCatalogOrphans, readCanvasCatalog };
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
ALL_BUILT_IN_WIRE: ()=>ALL_BUILT_IN_WIRE,
|
|
28
|
+
BYO_WIRE: ()=>BYO_WIRE,
|
|
29
|
+
HARMFUL_CONTENT_WIRE: ()=>HARMFUL_CONTENT_WIRE,
|
|
30
|
+
INTELLECTUAL_PROPERTY_WIRE: ()=>INTELLECTUAL_PROPERTY_WIRE,
|
|
31
|
+
LLM_AS_JUDGE_WIRE: ()=>LLM_AS_JUDGE_WIRE,
|
|
32
|
+
PII_DETECTION_WIRE: ()=>PII_DETECTION_WIRE,
|
|
33
|
+
PII_ENTITY_OPTIONS: ()=>PII_ENTITY_OPTIONS,
|
|
34
|
+
PROMPT_INJECTION_WIRE: ()=>PROMPT_INJECTION_WIRE,
|
|
35
|
+
RAW_PAYLOAD_WITH_NOISE: ()=>RAW_PAYLOAD_WITH_NOISE,
|
|
36
|
+
UNCURATED_WIRE: ()=>UNCURATED_WIRE,
|
|
37
|
+
USER_PROMPT_ATTACKS_WIRE: ()=>USER_PROMPT_ATTACKS_WIRE
|
|
38
|
+
});
|
|
39
|
+
const PII_ENTITY_OPTIONS = [
|
|
40
|
+
'Person',
|
|
41
|
+
'Address',
|
|
42
|
+
'Date',
|
|
43
|
+
'PhoneNumber',
|
|
44
|
+
'EugpsCoordinates',
|
|
45
|
+
'Email',
|
|
46
|
+
'CreditCardNumber',
|
|
47
|
+
'InternationalBankingAccountNumber',
|
|
48
|
+
'SwiftCode',
|
|
49
|
+
'ABARoutingNumber',
|
|
50
|
+
'USDriversLicenseNumber',
|
|
51
|
+
'UKDriversLicenseNumber',
|
|
52
|
+
'USIndividualTaxpayerIdentification',
|
|
53
|
+
'UKUniqueTaxpayerNumber',
|
|
54
|
+
'USBankAccountNumber',
|
|
55
|
+
'USSocialSecurityNumber',
|
|
56
|
+
'UsukPassportNumber',
|
|
57
|
+
'NOIdentityNumber',
|
|
58
|
+
'FINationalID',
|
|
59
|
+
'FIPassportNumber',
|
|
60
|
+
'SENationalID',
|
|
61
|
+
'DKPersonalIdentificationNumber',
|
|
62
|
+
'NLCitizensServiceNumber',
|
|
63
|
+
'URL',
|
|
64
|
+
'IPAddress'
|
|
65
|
+
];
|
|
66
|
+
const PII_DETECTION_WIRE = {
|
|
67
|
+
validator: 'pii_detection',
|
|
68
|
+
allowedScopes: [
|
|
69
|
+
'Agent',
|
|
70
|
+
'Llm',
|
|
71
|
+
'Tool'
|
|
72
|
+
],
|
|
73
|
+
status: 'Available',
|
|
74
|
+
parameters: [
|
|
75
|
+
{
|
|
76
|
+
id: 'entities',
|
|
77
|
+
type: 'enum-list',
|
|
78
|
+
required: true,
|
|
79
|
+
defaultValue: [
|
|
80
|
+
'Email',
|
|
81
|
+
'CreditCardNumber'
|
|
82
|
+
],
|
|
83
|
+
options: PII_ENTITY_OPTIONS
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: 'entityThresholds',
|
|
87
|
+
type: 'map-enum',
|
|
88
|
+
required: false,
|
|
89
|
+
defaultValue: {
|
|
90
|
+
Email: 0.8,
|
|
91
|
+
CreditCardNumber: 0.8
|
|
92
|
+
},
|
|
93
|
+
keySource: 'entities'
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
};
|
|
97
|
+
const HARMFUL_CONTENT_WIRE = {
|
|
98
|
+
validator: 'harmful_content',
|
|
99
|
+
allowedScopes: [
|
|
100
|
+
'Llm',
|
|
101
|
+
'Tool'
|
|
102
|
+
],
|
|
103
|
+
status: 'Available',
|
|
104
|
+
parameters: [
|
|
105
|
+
{
|
|
106
|
+
id: 'harmfulContentEntities',
|
|
107
|
+
type: 'enum-list',
|
|
108
|
+
required: true,
|
|
109
|
+
defaultValue: [
|
|
110
|
+
'Hate',
|
|
111
|
+
'Violence'
|
|
112
|
+
],
|
|
113
|
+
options: [
|
|
114
|
+
'Hate',
|
|
115
|
+
'SelfHarm',
|
|
116
|
+
'Sexual',
|
|
117
|
+
'Violence'
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: 'harmfulContentEntityThresholds',
|
|
122
|
+
type: 'map-enum',
|
|
123
|
+
required: false,
|
|
124
|
+
defaultValue: {
|
|
125
|
+
Hate: 2,
|
|
126
|
+
Violence: 2
|
|
127
|
+
},
|
|
128
|
+
keySource: 'harmfulContentEntities',
|
|
129
|
+
min: 0,
|
|
130
|
+
max: 6,
|
|
131
|
+
step: 2
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
};
|
|
135
|
+
const PROMPT_INJECTION_WIRE = {
|
|
136
|
+
validator: 'prompt_injection',
|
|
137
|
+
allowedScopes: [
|
|
138
|
+
'Llm'
|
|
139
|
+
],
|
|
140
|
+
status: 'Available',
|
|
141
|
+
parameters: [
|
|
142
|
+
{
|
|
143
|
+
id: 'threshold',
|
|
144
|
+
type: 'number',
|
|
145
|
+
required: true,
|
|
146
|
+
defaultValue: 0.7,
|
|
147
|
+
min: 0,
|
|
148
|
+
max: 1,
|
|
149
|
+
step: 0.1
|
|
150
|
+
}
|
|
151
|
+
]
|
|
152
|
+
};
|
|
153
|
+
const USER_PROMPT_ATTACKS_WIRE = {
|
|
154
|
+
validator: 'user_prompt_attacks',
|
|
155
|
+
allowedScopes: [
|
|
156
|
+
'Llm'
|
|
157
|
+
],
|
|
158
|
+
status: 'Available',
|
|
159
|
+
parameters: []
|
|
160
|
+
};
|
|
161
|
+
const INTELLECTUAL_PROPERTY_WIRE = {
|
|
162
|
+
validator: 'intellectual_property',
|
|
163
|
+
allowedScopes: [
|
|
164
|
+
'Llm',
|
|
165
|
+
'Tool'
|
|
166
|
+
],
|
|
167
|
+
status: 'FeatureDisabled',
|
|
168
|
+
parameters: [
|
|
169
|
+
{
|
|
170
|
+
id: 'ipEntities',
|
|
171
|
+
type: 'enum-list',
|
|
172
|
+
required: true,
|
|
173
|
+
defaultValue: [
|
|
174
|
+
'Text'
|
|
175
|
+
],
|
|
176
|
+
options: [
|
|
177
|
+
'Text',
|
|
178
|
+
'Code'
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
};
|
|
183
|
+
const LLM_AS_JUDGE_WIRE = {
|
|
184
|
+
validator: 'llm_as_judge',
|
|
185
|
+
allowedScopes: [
|
|
186
|
+
'Agent',
|
|
187
|
+
'Llm',
|
|
188
|
+
'Tool'
|
|
189
|
+
],
|
|
190
|
+
status: 'Available',
|
|
191
|
+
parameters: [
|
|
192
|
+
{
|
|
193
|
+
id: 'guardrailText',
|
|
194
|
+
type: 'text',
|
|
195
|
+
required: true,
|
|
196
|
+
defaultValue: null,
|
|
197
|
+
maxLength: 4000
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
id: 'model',
|
|
201
|
+
type: 'enum',
|
|
202
|
+
required: true,
|
|
203
|
+
defaultValue: null,
|
|
204
|
+
options: [
|
|
205
|
+
'gpt-4o-mini-2024-07-18',
|
|
206
|
+
'gpt-4o-2024-11-20'
|
|
207
|
+
]
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
id: 'positiveExamples',
|
|
211
|
+
type: 'text-list',
|
|
212
|
+
required: false,
|
|
213
|
+
maxItems: 5,
|
|
214
|
+
maxLength: 1000
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
id: 'negativeExamples',
|
|
218
|
+
type: 'text-list',
|
|
219
|
+
required: false,
|
|
220
|
+
defaultValue: null,
|
|
221
|
+
maxItems: 5,
|
|
222
|
+
maxLength: 1000
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
id: 'threshold',
|
|
226
|
+
type: 'number',
|
|
227
|
+
required: true,
|
|
228
|
+
defaultValue: 4,
|
|
229
|
+
min: 0,
|
|
230
|
+
max: 6,
|
|
231
|
+
step: 2
|
|
232
|
+
}
|
|
233
|
+
]
|
|
234
|
+
};
|
|
235
|
+
const BYO_WIRE = {
|
|
236
|
+
validator: 'pii_detection',
|
|
237
|
+
allowedScopes: [
|
|
238
|
+
'Llm'
|
|
239
|
+
],
|
|
240
|
+
status: 'Available',
|
|
241
|
+
displayName: 'Acme PII scan',
|
|
242
|
+
description: 'Runs the Acme detector over prompts and completions.',
|
|
243
|
+
byoValidatorName: 'acme-pii',
|
|
244
|
+
byoConnectorName: 'Acme AI Guardrails',
|
|
245
|
+
byoConnectorKey: 'acme',
|
|
246
|
+
byoGuardrailConnectionId: 'conn-1',
|
|
247
|
+
byoConfigurationId: 'cfg-1',
|
|
248
|
+
parameters: [
|
|
249
|
+
{
|
|
250
|
+
id: 'sensitivity',
|
|
251
|
+
type: 'enum',
|
|
252
|
+
required: true,
|
|
253
|
+
defaultValue: 'medium',
|
|
254
|
+
displayName: 'Sensitivity',
|
|
255
|
+
description: 'How aggressively to flag.',
|
|
256
|
+
options: [
|
|
257
|
+
'low',
|
|
258
|
+
'medium',
|
|
259
|
+
'high'
|
|
260
|
+
],
|
|
261
|
+
optionLabels: {
|
|
262
|
+
low: 'Low',
|
|
263
|
+
high: 'High'
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
]
|
|
267
|
+
};
|
|
268
|
+
const UNCURATED_WIRE = {
|
|
269
|
+
validator: 'topic_drift',
|
|
270
|
+
allowedScopes: [
|
|
271
|
+
'Llm'
|
|
272
|
+
],
|
|
273
|
+
status: 'Available',
|
|
274
|
+
parameters: [
|
|
275
|
+
{
|
|
276
|
+
id: 'maxDriftScore',
|
|
277
|
+
type: 'number',
|
|
278
|
+
required: true,
|
|
279
|
+
defaultValue: 0.5
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
id: 'allowedTopics',
|
|
283
|
+
type: 'enum-list',
|
|
284
|
+
required: false,
|
|
285
|
+
defaultValue: [],
|
|
286
|
+
options: [
|
|
287
|
+
'finance',
|
|
288
|
+
'legal'
|
|
289
|
+
]
|
|
290
|
+
}
|
|
291
|
+
]
|
|
292
|
+
};
|
|
293
|
+
const ALL_BUILT_IN_WIRE = [
|
|
294
|
+
PII_DETECTION_WIRE,
|
|
295
|
+
PROMPT_INJECTION_WIRE,
|
|
296
|
+
HARMFUL_CONTENT_WIRE,
|
|
297
|
+
USER_PROMPT_ATTACKS_WIRE,
|
|
298
|
+
INTELLECTUAL_PROPERTY_WIRE,
|
|
299
|
+
LLM_AS_JUDGE_WIRE
|
|
300
|
+
];
|
|
301
|
+
const RAW_PAYLOAD_WITH_NOISE = [
|
|
302
|
+
{
|
|
303
|
+
...PROMPT_INJECTION_WIRE,
|
|
304
|
+
executionStage: 'PreLlm',
|
|
305
|
+
internalRanking: 3,
|
|
306
|
+
displayName: '',
|
|
307
|
+
description: ''
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
validator: 'broken_validator',
|
|
311
|
+
allowedScopes: [
|
|
312
|
+
'Llm'
|
|
313
|
+
],
|
|
314
|
+
parameters: []
|
|
315
|
+
},
|
|
316
|
+
USER_PROMPT_ATTACKS_WIRE
|
|
317
|
+
];
|
|
318
|
+
exports.ALL_BUILT_IN_WIRE = __webpack_exports__.ALL_BUILT_IN_WIRE;
|
|
319
|
+
exports.BYO_WIRE = __webpack_exports__.BYO_WIRE;
|
|
320
|
+
exports.HARMFUL_CONTENT_WIRE = __webpack_exports__.HARMFUL_CONTENT_WIRE;
|
|
321
|
+
exports.INTELLECTUAL_PROPERTY_WIRE = __webpack_exports__.INTELLECTUAL_PROPERTY_WIRE;
|
|
322
|
+
exports.LLM_AS_JUDGE_WIRE = __webpack_exports__.LLM_AS_JUDGE_WIRE;
|
|
323
|
+
exports.PII_DETECTION_WIRE = __webpack_exports__.PII_DETECTION_WIRE;
|
|
324
|
+
exports.PII_ENTITY_OPTIONS = __webpack_exports__.PII_ENTITY_OPTIONS;
|
|
325
|
+
exports.PROMPT_INJECTION_WIRE = __webpack_exports__.PROMPT_INJECTION_WIRE;
|
|
326
|
+
exports.RAW_PAYLOAD_WITH_NOISE = __webpack_exports__.RAW_PAYLOAD_WITH_NOISE;
|
|
327
|
+
exports.UNCURATED_WIRE = __webpack_exports__.UNCURATED_WIRE;
|
|
328
|
+
exports.USER_PROMPT_ATTACKS_WIRE = __webpack_exports__.USER_PROMPT_ATTACKS_WIRE;
|
|
329
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
330
|
+
"ALL_BUILT_IN_WIRE",
|
|
331
|
+
"BYO_WIRE",
|
|
332
|
+
"HARMFUL_CONTENT_WIRE",
|
|
333
|
+
"INTELLECTUAL_PROPERTY_WIRE",
|
|
334
|
+
"LLM_AS_JUDGE_WIRE",
|
|
335
|
+
"PII_DETECTION_WIRE",
|
|
336
|
+
"PII_ENTITY_OPTIONS",
|
|
337
|
+
"PROMPT_INJECTION_WIRE",
|
|
338
|
+
"RAW_PAYLOAD_WITH_NOISE",
|
|
339
|
+
"UNCURATED_WIRE",
|
|
340
|
+
"USER_PROMPT_ATTACKS_WIRE"
|
|
341
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
342
|
+
Object.defineProperty(exports, '__esModule', {
|
|
343
|
+
value: true
|
|
344
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { GuardrailDefinitionWire } from '../definitions-wire';
|
|
2
|
+
export declare const PII_ENTITY_OPTIONS: string[];
|
|
3
|
+
export declare const PII_DETECTION_WIRE: GuardrailDefinitionWire;
|
|
4
|
+
export declare const HARMFUL_CONTENT_WIRE: GuardrailDefinitionWire;
|
|
5
|
+
export declare const PROMPT_INJECTION_WIRE: GuardrailDefinitionWire;
|
|
6
|
+
export declare const USER_PROMPT_ATTACKS_WIRE: GuardrailDefinitionWire;
|
|
7
|
+
export declare const INTELLECTUAL_PROPERTY_WIRE: GuardrailDefinitionWire;
|
|
8
|
+
export declare const LLM_AS_JUDGE_WIRE: GuardrailDefinitionWire;
|
|
9
|
+
export declare const BYO_WIRE: GuardrailDefinitionWire;
|
|
10
|
+
export declare const UNCURATED_WIRE: GuardrailDefinitionWire;
|
|
11
|
+
export declare const ALL_BUILT_IN_WIRE: GuardrailDefinitionWire[];
|
|
12
|
+
export declare const RAW_PAYLOAD_WITH_NOISE: unknown;
|
|
13
|
+
//# sourceMappingURL=definitions-wire.fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions-wire.fixtures.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/__fixtures__/definitions-wire.fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAUnE,eAAO,MAAM,kBAAkB,EAAE,MAAM,EA0BtC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,uBAsBhC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,uBAuBlC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,uBAenC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,uBAKtC,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,uBAaxC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,uBA6C/B,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,uBAuBtB,CAAC;AAGF,eAAO,MAAM,cAAc,EAAE,uBAc5B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,uBAAuB,EAOtD,CAAC;AAMF,eAAO,MAAM,sBAAsB,EAAE,OAgBpC,CAAC"}
|