Skip to content

Commit

Permalink
chore: Initial API design
Browse files Browse the repository at this point in the history
  • Loading branch information
KavithaSiva committed Jul 26, 2024
1 parent 7014a08 commit eb4a115
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
18 changes: 18 additions & 0 deletions packages/gen-ai-hub/src/orchestration/orchestration-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
};

Expand Down
50 changes: 49 additions & 1 deletion packages/gen-ai-hub/src/orchestration/orchestration-types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BaseLlmParameters } from '../core/index.js';
import {
AzureContentSafety,
ChatMessages,
CompletionPostResponse,
InputParamsEntry,
Expand Down Expand Up @@ -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;
}

0 comments on commit eb4a115

Please sign in to comment.