opik 2.2.144 → 2.2.146
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/chunk-Q3WEV5BO.js +404 -0
- package/dist/cli.js +1 -1
- package/dist/index.cjs +36 -36
- package/dist/index.d.cts +337 -4
- package/dist/index.d.ts +337 -4
- package/dist/index.js +1 -1
- package/dist/{suite-UURQQHOH.js → suite-6FRA5UYK.js} +1 -1
- package/package.json +1 -1
- package/dist/chunk-H2OLELAZ.js +0 -404
package/dist/index.d.cts
CHANGED
|
@@ -1679,6 +1679,56 @@ declare const FindFeedbackDefinitionsRequestType: {
|
|
|
1679
1679
|
};
|
|
1680
1680
|
type FindFeedbackDefinitionsRequestType = (typeof FindFeedbackDefinitionsRequestType)[keyof typeof FindFeedbackDefinitionsRequestType];
|
|
1681
1681
|
|
|
1682
|
+
/**
|
|
1683
|
+
* @example
|
|
1684
|
+
* {}
|
|
1685
|
+
*/
|
|
1686
|
+
type DeleteGuardrailPolicyRequest = {};
|
|
1687
|
+
|
|
1688
|
+
/**
|
|
1689
|
+
* @example
|
|
1690
|
+
* {}
|
|
1691
|
+
*/
|
|
1692
|
+
interface FindGuardrailPoliciesRequest {
|
|
1693
|
+
page?: number;
|
|
1694
|
+
size?: number;
|
|
1695
|
+
name?: string;
|
|
1696
|
+
names?: string;
|
|
1697
|
+
executionScope?: FindGuardrailPoliciesRequestExecutionScope;
|
|
1698
|
+
sorting?: string;
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
/**
|
|
1702
|
+
* @example
|
|
1703
|
+
* {}
|
|
1704
|
+
*/
|
|
1705
|
+
type GetGuardrailPolicyByIdRequest = {};
|
|
1706
|
+
|
|
1707
|
+
/**
|
|
1708
|
+
* @example
|
|
1709
|
+
* {
|
|
1710
|
+
* body: {
|
|
1711
|
+
* name: "name",
|
|
1712
|
+
* rules: [{
|
|
1713
|
+
* type: "TOPIC",
|
|
1714
|
+
* config: {
|
|
1715
|
+
* "key": "value"
|
|
1716
|
+
* }
|
|
1717
|
+
* }]
|
|
1718
|
+
* }
|
|
1719
|
+
* }
|
|
1720
|
+
*/
|
|
1721
|
+
interface UpdateGuardrailPolicyRequest {
|
|
1722
|
+
body: GuardrailPolicyWrite;
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
/** Filter policies by execution scope */
|
|
1726
|
+
declare const FindGuardrailPoliciesRequestExecutionScope: {
|
|
1727
|
+
readonly OnRequest: "on_request";
|
|
1728
|
+
readonly Global: "global";
|
|
1729
|
+
};
|
|
1730
|
+
type FindGuardrailPoliciesRequestExecutionScope = (typeof FindGuardrailPoliciesRequestExecutionScope)[keyof typeof FindGuardrailPoliciesRequestExecutionScope];
|
|
1731
|
+
|
|
1682
1732
|
/**
|
|
1683
1733
|
* @example
|
|
1684
1734
|
* {
|
|
@@ -1700,6 +1750,25 @@ interface GuardrailBatchWrite {
|
|
|
1700
1750
|
guardrails: GuardrailWrite[];
|
|
1701
1751
|
}
|
|
1702
1752
|
|
|
1753
|
+
/**
|
|
1754
|
+
* @example
|
|
1755
|
+
* {
|
|
1756
|
+
* text: "text",
|
|
1757
|
+
* validations: [{
|
|
1758
|
+
* type: "TOPIC",
|
|
1759
|
+
* config: {
|
|
1760
|
+
* "key": "value"
|
|
1761
|
+
* }
|
|
1762
|
+
* }]
|
|
1763
|
+
* }
|
|
1764
|
+
*/
|
|
1765
|
+
interface GuardrailsValidationRequest {
|
|
1766
|
+
/** The text to check, at most 16384 characters as the decision service counts them: on the text's JSON encoding, so the two quotes count, a quote, backslash or line break counts as 2, and any other control or non-ASCII character as 6 (an emoji as 12). In practice about 16,380 characters of English text fit, about 2,730 of text in Cyrillic, Greek, Hebrew, Arabic, Chinese or Japanese, and about 1,365 emoji. A longer text is rejected rather than cut. */
|
|
1767
|
+
text: string;
|
|
1768
|
+
/** The checks to run. Together they must fit in 64 questions to the decision service, asked in up to two calls of 32: each PII class and each topic list is one question, prompt injection is one */
|
|
1769
|
+
validations: ValidationDescriptor[];
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1703
1772
|
/**
|
|
1704
1773
|
* @example
|
|
1705
1774
|
* {}
|
|
@@ -5043,7 +5112,6 @@ interface DashboardPublic {
|
|
|
5043
5112
|
/** Project ID. Takes precedence over project_name when both are provided. */
|
|
5044
5113
|
projectId?: string;
|
|
5045
5114
|
name: string;
|
|
5046
|
-
slug?: string;
|
|
5047
5115
|
type?: DashboardPublicType;
|
|
5048
5116
|
scope?: DashboardPublicScope;
|
|
5049
5117
|
description?: string;
|
|
@@ -6247,6 +6315,90 @@ interface GroupDetails {
|
|
|
6247
6315
|
groupsDetails?: GroupDetail[];
|
|
6248
6316
|
}
|
|
6249
6317
|
|
|
6318
|
+
interface GuardrailPolicyPagePublic {
|
|
6319
|
+
content?: GuardrailPolicyPublic[];
|
|
6320
|
+
page?: number;
|
|
6321
|
+
size?: number;
|
|
6322
|
+
total?: number;
|
|
6323
|
+
sortableBy?: string[];
|
|
6324
|
+
}
|
|
6325
|
+
|
|
6326
|
+
interface GuardrailPolicyPublic {
|
|
6327
|
+
/** Optional on create, generated when missing, as for prompts and datasets. Ignored on update, where the path names the policy */
|
|
6328
|
+
id?: string;
|
|
6329
|
+
/** The SDK names policies by name, so it is unique in the workspace, ignoring case */
|
|
6330
|
+
name: string;
|
|
6331
|
+
description?: string;
|
|
6332
|
+
/** on_request applies the policy when the SDK names it, global applies it to every guardrail built from stored policies in the workspace. Missing or null means on_request */
|
|
6333
|
+
executionScope?: GuardrailPolicyPublicExecutionScope;
|
|
6334
|
+
/** At most one rule per type */
|
|
6335
|
+
rules: GuardrailPolicyRulePublic[];
|
|
6336
|
+
createdAt?: Date;
|
|
6337
|
+
createdBy?: string;
|
|
6338
|
+
lastUpdatedAt?: Date;
|
|
6339
|
+
lastUpdatedBy?: string;
|
|
6340
|
+
}
|
|
6341
|
+
|
|
6342
|
+
/** on_request applies the policy when the SDK names it, global applies it to every guardrail built from stored policies in the workspace. Missing or null means on_request */
|
|
6343
|
+
declare const GuardrailPolicyPublicExecutionScope: {
|
|
6344
|
+
readonly OnRequest: "on_request";
|
|
6345
|
+
readonly Global: "global";
|
|
6346
|
+
};
|
|
6347
|
+
type GuardrailPolicyPublicExecutionScope = (typeof GuardrailPolicyPublicExecutionScope)[keyof typeof GuardrailPolicyPublicExecutionScope];
|
|
6348
|
+
|
|
6349
|
+
/**
|
|
6350
|
+
* At most one rule per type
|
|
6351
|
+
*/
|
|
6352
|
+
interface GuardrailPolicyRulePublic {
|
|
6353
|
+
type: GuardrailPolicyRulePublicType;
|
|
6354
|
+
config: JsonNode;
|
|
6355
|
+
}
|
|
6356
|
+
|
|
6357
|
+
declare const GuardrailPolicyRulePublicType: {
|
|
6358
|
+
readonly Topic: "TOPIC";
|
|
6359
|
+
readonly Pii: "PII";
|
|
6360
|
+
readonly LlmJudge: "LLM_JUDGE";
|
|
6361
|
+
readonly PromptInjection: "PROMPT_INJECTION";
|
|
6362
|
+
readonly CustomClassifier: "CUSTOM_CLASSIFIER";
|
|
6363
|
+
};
|
|
6364
|
+
type GuardrailPolicyRulePublicType = (typeof GuardrailPolicyRulePublicType)[keyof typeof GuardrailPolicyRulePublicType];
|
|
6365
|
+
|
|
6366
|
+
/**
|
|
6367
|
+
* At most one rule per type
|
|
6368
|
+
*/
|
|
6369
|
+
interface GuardrailPolicyRuleWrite {
|
|
6370
|
+
type: GuardrailPolicyRuleWriteType;
|
|
6371
|
+
config: JsonNode;
|
|
6372
|
+
}
|
|
6373
|
+
|
|
6374
|
+
declare const GuardrailPolicyRuleWriteType: {
|
|
6375
|
+
readonly Topic: "TOPIC";
|
|
6376
|
+
readonly Pii: "PII";
|
|
6377
|
+
readonly LlmJudge: "LLM_JUDGE";
|
|
6378
|
+
readonly PromptInjection: "PROMPT_INJECTION";
|
|
6379
|
+
readonly CustomClassifier: "CUSTOM_CLASSIFIER";
|
|
6380
|
+
};
|
|
6381
|
+
type GuardrailPolicyRuleWriteType = (typeof GuardrailPolicyRuleWriteType)[keyof typeof GuardrailPolicyRuleWriteType];
|
|
6382
|
+
|
|
6383
|
+
interface GuardrailPolicyWrite {
|
|
6384
|
+
/** Optional on create, generated when missing, as for prompts and datasets. Ignored on update, where the path names the policy */
|
|
6385
|
+
id?: string;
|
|
6386
|
+
/** The SDK names policies by name, so it is unique in the workspace, ignoring case */
|
|
6387
|
+
name: string;
|
|
6388
|
+
description?: string;
|
|
6389
|
+
/** on_request applies the policy when the SDK names it, global applies it to every guardrail built from stored policies in the workspace. Missing or null means on_request */
|
|
6390
|
+
executionScope?: GuardrailPolicyWriteExecutionScope;
|
|
6391
|
+
/** At most one rule per type */
|
|
6392
|
+
rules: GuardrailPolicyRuleWrite[];
|
|
6393
|
+
}
|
|
6394
|
+
|
|
6395
|
+
/** on_request applies the policy when the SDK names it, global applies it to every guardrail built from stored policies in the workspace. Missing or null means on_request */
|
|
6396
|
+
declare const GuardrailPolicyWriteExecutionScope: {
|
|
6397
|
+
readonly OnRequest: "on_request";
|
|
6398
|
+
readonly Global: "global";
|
|
6399
|
+
};
|
|
6400
|
+
type GuardrailPolicyWriteExecutionScope = (typeof GuardrailPolicyWriteExecutionScope)[keyof typeof GuardrailPolicyWriteExecutionScope];
|
|
6401
|
+
|
|
6250
6402
|
interface GuardrailsValidation {
|
|
6251
6403
|
spanId?: string;
|
|
6252
6404
|
checks?: Check[];
|
|
@@ -6257,6 +6409,11 @@ interface GuardrailsValidationPublic {
|
|
|
6257
6409
|
checks?: CheckPublic[];
|
|
6258
6410
|
}
|
|
6259
6411
|
|
|
6412
|
+
interface GuardrailsValidationResponse {
|
|
6413
|
+
validationPassed?: boolean;
|
|
6414
|
+
validations: ValidationResult[];
|
|
6415
|
+
}
|
|
6416
|
+
|
|
6260
6417
|
interface GuardrailWrite {
|
|
6261
6418
|
entityId: string;
|
|
6262
6419
|
secondaryId: string;
|
|
@@ -7622,6 +7779,7 @@ interface ServiceTogglesConfig {
|
|
|
7622
7779
|
spanLlmAsJudgeEnabled: boolean;
|
|
7623
7780
|
spanUserDefinedMetricPythonEnabled: boolean;
|
|
7624
7781
|
guardrailsEnabled: boolean;
|
|
7782
|
+
guardrailsValidationsEnabled: boolean;
|
|
7625
7783
|
opikAiEnabled: boolean;
|
|
7626
7784
|
alertsEnabled: boolean;
|
|
7627
7785
|
welcomeWizardEnabled: boolean;
|
|
@@ -8631,6 +8789,41 @@ interface ValidatedToken {
|
|
|
8631
8789
|
expiresAt?: Date;
|
|
8632
8790
|
}
|
|
8633
8791
|
|
|
8792
|
+
/**
|
|
8793
|
+
* The checks to run. Together they must fit in 64 questions to the decision service, asked in up to two calls of 32: each PII class and each topic list is one question, prompt injection is one
|
|
8794
|
+
*/
|
|
8795
|
+
interface ValidationDescriptor {
|
|
8796
|
+
type: ValidationDescriptorType;
|
|
8797
|
+
config: JsonNode;
|
|
8798
|
+
}
|
|
8799
|
+
|
|
8800
|
+
declare const ValidationDescriptorType: {
|
|
8801
|
+
readonly Topic: "TOPIC";
|
|
8802
|
+
readonly Pii: "PII";
|
|
8803
|
+
readonly LlmJudge: "LLM_JUDGE";
|
|
8804
|
+
readonly PromptInjection: "PROMPT_INJECTION";
|
|
8805
|
+
readonly CustomClassifier: "CUSTOM_CLASSIFIER";
|
|
8806
|
+
};
|
|
8807
|
+
type ValidationDescriptorType = (typeof ValidationDescriptorType)[keyof typeof ValidationDescriptorType];
|
|
8808
|
+
|
|
8809
|
+
interface ValidationResult {
|
|
8810
|
+
validationPassed?: boolean;
|
|
8811
|
+
type: ValidationResultType;
|
|
8812
|
+
validationConfig: JsonNode;
|
|
8813
|
+
validationDetails: JsonNode;
|
|
8814
|
+
/** Set when the check could not run; the entry then passes */
|
|
8815
|
+
error?: string;
|
|
8816
|
+
}
|
|
8817
|
+
|
|
8818
|
+
declare const ValidationResultType: {
|
|
8819
|
+
readonly Topic: "TOPIC";
|
|
8820
|
+
readonly Pii: "PII";
|
|
8821
|
+
readonly LlmJudge: "LLM_JUDGE";
|
|
8822
|
+
readonly PromptInjection: "PROMPT_INJECTION";
|
|
8823
|
+
readonly CustomClassifier: "CUSTOM_CLASSIFIER";
|
|
8824
|
+
};
|
|
8825
|
+
type ValidationResultType = (typeof ValidationResultType)[keyof typeof ValidationResultType];
|
|
8826
|
+
|
|
8634
8827
|
interface ValueEntry {
|
|
8635
8828
|
value?: number;
|
|
8636
8829
|
reason?: string;
|
|
@@ -10057,7 +10250,6 @@ declare class DashboardsClient {
|
|
|
10057
10250
|
* @param {DashboardsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
10058
10251
|
*
|
|
10059
10252
|
* @throws {@link OpikApi.NotFoundError}
|
|
10060
|
-
* @throws {@link OpikApi.ConflictError}
|
|
10061
10253
|
*
|
|
10062
10254
|
* @example
|
|
10063
10255
|
* await client.dashboards.updateDashboard("dashboardId", {
|
|
@@ -11109,6 +11301,121 @@ declare class FeedbackDefinitionsClient {
|
|
|
11109
11301
|
private __deleteFeedbackDefinitionsBatch;
|
|
11110
11302
|
}
|
|
11111
11303
|
|
|
11304
|
+
declare namespace GuardrailPoliciesClient {
|
|
11305
|
+
type Options = BaseClientOptions;
|
|
11306
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
11307
|
+
}
|
|
11308
|
+
}
|
|
11309
|
+
/**
|
|
11310
|
+
* Workspace guardrail policy resources
|
|
11311
|
+
*/
|
|
11312
|
+
declare class GuardrailPoliciesClient {
|
|
11313
|
+
protected readonly _options: NormalizedClientOptions<GuardrailPoliciesClient.Options>;
|
|
11314
|
+
constructor(options?: GuardrailPoliciesClient.Options);
|
|
11315
|
+
/**
|
|
11316
|
+
* Find guardrail policies in a workspace
|
|
11317
|
+
*
|
|
11318
|
+
* @param {OpikApi.FindGuardrailPoliciesRequest} request
|
|
11319
|
+
* @param {GuardrailPoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
11320
|
+
*
|
|
11321
|
+
* @throws {@link OpikApi.BadRequestError}
|
|
11322
|
+
* @throws {@link OpikApi.ForbiddenError}
|
|
11323
|
+
* @throws {@link OpikApi.ServiceUnavailableError}
|
|
11324
|
+
*
|
|
11325
|
+
* @example
|
|
11326
|
+
* await client.guardrailPolicies.findGuardrailPolicies()
|
|
11327
|
+
*/
|
|
11328
|
+
findGuardrailPolicies(request?: FindGuardrailPoliciesRequest, requestOptions?: GuardrailPoliciesClient.RequestOptions): HttpResponsePromise<GuardrailPolicyPagePublic>;
|
|
11329
|
+
private __findGuardrailPolicies;
|
|
11330
|
+
/**
|
|
11331
|
+
* Create a guardrail policy with its rules in a workspace
|
|
11332
|
+
*
|
|
11333
|
+
* @param {OpikApi.GuardrailPolicyWrite} request
|
|
11334
|
+
* @param {GuardrailPoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
11335
|
+
*
|
|
11336
|
+
* @throws {@link OpikApi.BadRequestError}
|
|
11337
|
+
* @throws {@link OpikApi.ForbiddenError}
|
|
11338
|
+
* @throws {@link OpikApi.ConflictError}
|
|
11339
|
+
* @throws {@link OpikApi.UnprocessableEntityError}
|
|
11340
|
+
* @throws {@link OpikApi.TooManyRequestsError}
|
|
11341
|
+
* @throws {@link OpikApi.ServiceUnavailableError}
|
|
11342
|
+
*
|
|
11343
|
+
* @example
|
|
11344
|
+
* await client.guardrailPolicies.createGuardrailPolicy({
|
|
11345
|
+
* name: "name",
|
|
11346
|
+
* rules: [{
|
|
11347
|
+
* type: "TOPIC",
|
|
11348
|
+
* config: {
|
|
11349
|
+
* "key": "value"
|
|
11350
|
+
* }
|
|
11351
|
+
* }]
|
|
11352
|
+
* })
|
|
11353
|
+
*/
|
|
11354
|
+
createGuardrailPolicy(request: GuardrailPolicyWrite, requestOptions?: GuardrailPoliciesClient.RequestOptions): HttpResponsePromise<void>;
|
|
11355
|
+
private __createGuardrailPolicy;
|
|
11356
|
+
/**
|
|
11357
|
+
* Get guardrail policy by id
|
|
11358
|
+
*
|
|
11359
|
+
* @param {string} id
|
|
11360
|
+
* @param {OpikApi.GetGuardrailPolicyByIdRequest} request
|
|
11361
|
+
* @param {GuardrailPoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
11362
|
+
*
|
|
11363
|
+
* @throws {@link OpikApi.ForbiddenError}
|
|
11364
|
+
* @throws {@link OpikApi.NotFoundError}
|
|
11365
|
+
* @throws {@link OpikApi.ServiceUnavailableError}
|
|
11366
|
+
*
|
|
11367
|
+
* @example
|
|
11368
|
+
* await client.guardrailPolicies.getGuardrailPolicyById("id")
|
|
11369
|
+
*/
|
|
11370
|
+
getGuardrailPolicyById(id: string, request?: GetGuardrailPolicyByIdRequest, requestOptions?: GuardrailPoliciesClient.RequestOptions): HttpResponsePromise<GuardrailPolicyPublic>;
|
|
11371
|
+
private __getGuardrailPolicyById;
|
|
11372
|
+
/**
|
|
11373
|
+
* Replace a guardrail policy, rules included: a rule left out of the request is removed
|
|
11374
|
+
*
|
|
11375
|
+
* @param {string} id
|
|
11376
|
+
* @param {OpikApi.UpdateGuardrailPolicyRequest} request
|
|
11377
|
+
* @param {GuardrailPoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
11378
|
+
*
|
|
11379
|
+
* @throws {@link OpikApi.BadRequestError}
|
|
11380
|
+
* @throws {@link OpikApi.ForbiddenError}
|
|
11381
|
+
* @throws {@link OpikApi.NotFoundError}
|
|
11382
|
+
* @throws {@link OpikApi.ConflictError}
|
|
11383
|
+
* @throws {@link OpikApi.UnprocessableEntityError}
|
|
11384
|
+
* @throws {@link OpikApi.TooManyRequestsError}
|
|
11385
|
+
* @throws {@link OpikApi.ServiceUnavailableError}
|
|
11386
|
+
*
|
|
11387
|
+
* @example
|
|
11388
|
+
* await client.guardrailPolicies.updateGuardrailPolicy("id", {
|
|
11389
|
+
* body: {
|
|
11390
|
+
* name: "name",
|
|
11391
|
+
* rules: [{
|
|
11392
|
+
* type: "TOPIC",
|
|
11393
|
+
* config: {
|
|
11394
|
+
* "key": "value"
|
|
11395
|
+
* }
|
|
11396
|
+
* }]
|
|
11397
|
+
* }
|
|
11398
|
+
* })
|
|
11399
|
+
*/
|
|
11400
|
+
updateGuardrailPolicy(id: string, request: UpdateGuardrailPolicyRequest, requestOptions?: GuardrailPoliciesClient.RequestOptions): HttpResponsePromise<void>;
|
|
11401
|
+
private __updateGuardrailPolicy;
|
|
11402
|
+
/**
|
|
11403
|
+
* Delete a guardrail policy and its rules
|
|
11404
|
+
*
|
|
11405
|
+
* @param {string} id
|
|
11406
|
+
* @param {OpikApi.DeleteGuardrailPolicyRequest} request
|
|
11407
|
+
* @param {GuardrailPoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
11408
|
+
*
|
|
11409
|
+
* @throws {@link OpikApi.ForbiddenError}
|
|
11410
|
+
* @throws {@link OpikApi.ServiceUnavailableError}
|
|
11411
|
+
*
|
|
11412
|
+
* @example
|
|
11413
|
+
* await client.guardrailPolicies.deleteGuardrailPolicy("id")
|
|
11414
|
+
*/
|
|
11415
|
+
deleteGuardrailPolicy(id: string, request?: DeleteGuardrailPolicyRequest, requestOptions?: GuardrailPoliciesClient.RequestOptions): HttpResponsePromise<void>;
|
|
11416
|
+
private __deleteGuardrailPolicy;
|
|
11417
|
+
}
|
|
11418
|
+
|
|
11112
11419
|
declare namespace GuardrailsClient {
|
|
11113
11420
|
type Options = BaseClientOptions;
|
|
11114
11421
|
interface RequestOptions extends BaseRequestOptions {
|
|
@@ -11144,6 +11451,32 @@ declare class GuardrailsClient {
|
|
|
11144
11451
|
*/
|
|
11145
11452
|
createGuardrails(request: GuardrailBatchWrite, requestOptions?: GuardrailsClient.RequestOptions): HttpResponsePromise<void>;
|
|
11146
11453
|
private __createGuardrails;
|
|
11454
|
+
/**
|
|
11455
|
+
* Runs the requested checks on the text through the Opik inference decision service and returns a verdict per check. Writes nothing: the SDK reports the results to the guardrails batch endpoint, as before.
|
|
11456
|
+
*
|
|
11457
|
+
* @param {OpikApi.GuardrailsValidationRequest} request
|
|
11458
|
+
* @param {GuardrailsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
11459
|
+
*
|
|
11460
|
+
* @throws {@link OpikApi.BadRequestError}
|
|
11461
|
+
* @throws {@link OpikApi.UnauthorizedError}
|
|
11462
|
+
* @throws {@link OpikApi.ForbiddenError}
|
|
11463
|
+
* @throws {@link OpikApi.UnprocessableEntityError}
|
|
11464
|
+
* @throws {@link OpikApi.TooManyRequestsError}
|
|
11465
|
+
* @throws {@link OpikApi.ServiceUnavailableError}
|
|
11466
|
+
*
|
|
11467
|
+
* @example
|
|
11468
|
+
* await client.guardrails.validateGuardrails({
|
|
11469
|
+
* text: "text",
|
|
11470
|
+
* validations: [{
|
|
11471
|
+
* type: "TOPIC",
|
|
11472
|
+
* config: {
|
|
11473
|
+
* "key": "value"
|
|
11474
|
+
* }
|
|
11475
|
+
* }]
|
|
11476
|
+
* })
|
|
11477
|
+
*/
|
|
11478
|
+
validateGuardrails(request: GuardrailsValidationRequest, requestOptions?: GuardrailsClient.RequestOptions): HttpResponsePromise<GuardrailsValidationResponse>;
|
|
11479
|
+
private __validateGuardrails;
|
|
11147
11480
|
}
|
|
11148
11481
|
|
|
11149
11482
|
declare namespace InsightsViewsClient {
|
|
@@ -11218,7 +11551,6 @@ declare class InsightsViewsClient {
|
|
|
11218
11551
|
* @param {InsightsViewsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
11219
11552
|
*
|
|
11220
11553
|
* @throws {@link OpikApi.NotFoundError}
|
|
11221
|
-
* @throws {@link OpikApi.ConflictError}
|
|
11222
11554
|
*
|
|
11223
11555
|
* @example
|
|
11224
11556
|
* await client.insightsViews.updateInsightsView("insightsViewId", {
|
|
@@ -14156,6 +14488,7 @@ declare class OpikApiClient {
|
|
|
14156
14488
|
protected _environments: EnvironmentsClient | undefined;
|
|
14157
14489
|
protected _experiments: ExperimentsClient | undefined;
|
|
14158
14490
|
protected _feedbackDefinitions: FeedbackDefinitionsClient | undefined;
|
|
14491
|
+
protected _guardrailPolicies: GuardrailPoliciesClient | undefined;
|
|
14159
14492
|
protected _guardrails: GuardrailsClient | undefined;
|
|
14160
14493
|
protected _insightsViews: InsightsViewsClient | undefined;
|
|
14161
14494
|
protected _llmModels: LlmModelsClient | undefined;
|
|
@@ -14200,6 +14533,7 @@ declare class OpikApiClient {
|
|
|
14200
14533
|
get environments(): EnvironmentsClient;
|
|
14201
14534
|
get experiments(): ExperimentsClient;
|
|
14202
14535
|
get feedbackDefinitions(): FeedbackDefinitionsClient;
|
|
14536
|
+
get guardrailPolicies(): GuardrailPoliciesClient;
|
|
14203
14537
|
get guardrails(): GuardrailsClient;
|
|
14204
14538
|
get insightsViews(): InsightsViewsClient;
|
|
14205
14539
|
get llmModels(): LlmModelsClient;
|
|
@@ -16147,7 +16481,6 @@ declare abstract class BaseAnnotationQueue {
|
|
|
16147
16481
|
delete(): Promise<void>;
|
|
16148
16482
|
protected addItemsBatch(ids: string[]): Promise<void>;
|
|
16149
16483
|
protected removeItemsBatch(ids: string[]): Promise<void>;
|
|
16150
|
-
protected fetchAllItems<T>(fetchPage: (limit: number, lastRetrievedId?: string) => Promise<T[]>, getCursor: (item: T) => string | undefined): Promise<T[]>;
|
|
16151
16484
|
}
|
|
16152
16485
|
|
|
16153
16486
|
declare class TracesAnnotationQueue extends BaseAnnotationQueue {
|