diff --git a/packages/gen-ai-hub/src/orchestration/orchestration-client.test.ts b/packages/gen-ai-hub/src/orchestration/orchestration-client.test.ts index 321857b4..bd9456bc 100644 --- a/packages/gen-ai-hub/src/orchestration/orchestration-client.test.ts +++ b/packages/gen-ai-hub/src/orchestration/orchestration-client.test.ts @@ -35,6 +35,24 @@ describe('GenAiHubClient', () => { }, prompt: { template: [{ role: 'user', content: 'Hello!' }] + }, + filterConfig: { + input: { + AzureContentSafety: { + Hate: 0, + SelfHarm: 2, + Sexual: 4, + Violence: 6 + } + }, + output: { + AzureContentSafety: { + Hate: 0, + SelfHarm: 2, + Sexual: 4, + Violence: 6 + } + } } }; diff --git a/packages/gen-ai-hub/src/orchestration/orchestration-types.ts b/packages/gen-ai-hub/src/orchestration/orchestration-types.ts index 2ca7d3e4..40844557 100644 --- a/packages/gen-ai-hub/src/orchestration/orchestration-types.ts +++ b/packages/gen-ai-hub/src/orchestration/orchestration-types.ts @@ -1,5 +1,6 @@ import { BaseLlmParameters } from '../core/index.js'; import { + AzureContentSafety, ChatMessages, CompletionPostResponse, InputParamsEntry, @@ -39,16 +40,63 @@ export interface PromptConfig { */ export type LlmConfig = LLMModuleConfig; +/** + * Wrapper object to configure Filters. + */ +export interface FilterConfig { + /** + * Input configuration for filtering provider. + */ + input?: FilterServiceProvider | FilterServiceProvider[]; + /** + * Output configuration for filtering provider. + */ + output?: FilterServiceProvider | FilterServiceProvider[]; +} +/** + * Wrapper object to configure the filter service provider. + */ +export interface FilterServiceProvider { + /** + * Azure filtering service provider. + */ + AzureContentSafety: AzureContentSafety; +} + +/** + * Azure content safety service provider. + */ +export interface AzureContentSafetyServiceProvider { + /** + * Azure content safety filter configuration. + */ + AzureContentSafety?: AzureContentSafety; +} + +/** + * Azure content safety service provider. + */ +export interface OpenAIContentSafetyServiceProvider { + /** + * Azure content safety filter configuration. + */ + OpenAIContentSafety?: AzureContentSafety; +} + /** * Wrapper object to encompass Orchestration options. */ export interface OrchestrationCompletionParameters { /** - * Prompt options. + * Prompt configuration options. */ prompt: PromptConfig; /** * Llm configuration options. */ llmConfig: LlmConfig; + /** + * Filter configuration options. + */ + filterConfig?: FilterConfig; }