Skip to content

Commit

Permalink
chore:add generated content filtering schema
Browse files Browse the repository at this point in the history
  • Loading branch information
KavithaSiva committed Jul 25, 2024
1 parent e0adcb5 commit 7014a08
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/
import type { AzureThreshold } from './azure-threshold.js';
/**
* Representation of the 'AzureContentSafety' schema.
*/
export type AzureContentSafety = {
Hate?: AzureThreshold;
SelfHarm?: AzureThreshold;
Sexual?: AzureThreshold;
Violence?: AzureThreshold;
} & Record<string, any>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/

/**
* Representation of the 'AzureThreshold' schema.
*/
export type AzureThreshold = 0 | 2 | 4 | 6;
19 changes: 19 additions & 0 deletions packages/gen-ai-hub/src/orchestration/api/schema/filter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/
import type { ProviderType } from './provider-type.js';
/**
* Representation of the 'Filter' schema.
*/
export type Filter = {
/**
* Type of filtering service provider.
*/
type: ProviderType;
/**
* Filters classifiers to be used.
*/
config?: Record<string, any>;
} & Record<string, any>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/
import type { Filter } from './filter.js';
/**
* Representation of the 'FilteringConfig' schema.
*/
export type FilteringConfig = {
/**
* Filters to be used.
*/
filters: Filter[];
} & Record<string, any>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/
import type { FilteringConfig } from './filtering-config.js';
/**
* Representation of the 'FilteringModuleConfig' schema.
*/
export interface FilteringModuleConfig {
/**
* List of provider type and filters.
*/
input?: FilteringConfig;
/**
* List of provider type and filters.
*/
output?: FilteringConfig;
}
7 changes: 7 additions & 0 deletions packages/gen-ai-hub/src/orchestration/api/schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,10 @@ export * from './llm-choice.js';
export * from './token-usage.js';
export * from './templating-module-config.js';
export * from './error-response.js';
export * from './templating-module-result.js';
export * from './filtering-module-config.js';
export * from './filtering-config.js';
export * from './filter.js';
export * from './azure-content-safety.js';
export * from './provider-type.js';
export * from './azure-threshold.js';
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
*/
import type { LLMModuleConfig } from './llm-module-config.js';
import type { TemplatingModuleConfig } from './templating-module-config.js';
import type { FilteringModuleConfig } from './filtering-module-config.js';
/**
* Representation of the 'ModuleConfigs' schema.
*/
export type ModuleConfigs = {
llm_module_config: LLMModuleConfig;
templating_module_config: TemplatingModuleConfig;
filtering_module_config?: FilteringModuleConfig;
} & Record<string, any>;
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
import type { TemplatingModuleResult } from './templating-module-result.js';
import type { LLMModuleResult } from './llm-module-result.js';
import { GenericModuleResult } from './generic-module-result.js';
/**
* Results of each module.
*/
Expand All @@ -17,4 +18,12 @@ export interface ModuleResults {
* Results of the LLM module.
*/
llm?: LLMModuleResult;
/**
* Results of the input filtering module.
*/
input_filtering?: GenericModuleResult;
/**
* Results of the output filtering module.
*/
output_filtering?: GenericModuleResult;
}
10 changes: 10 additions & 0 deletions packages/gen-ai-hub/src/orchestration/api/schema/provider-type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/

/**
* Representation of the 'ProviderType' schema.
*/
export type ProviderType = 'azure_content_safety';

0 comments on commit 7014a08

Please sign in to comment.