Skip to content

Commit

Permalink
fix: Use types instead of interfaces (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjtang1985 authored Nov 7, 2024
1 parent b850dc9 commit 6fe32b8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .changeset/interface-vs-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@sap-ai-sdk/orchestration': minor
---
[Compatibility Note] Switch some of the orchestration interfaces to types, as they were introduced by accident.

[Compatibility Note] Remove `grounding` key from the type `ModuleResults`.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
*/
import type { AzureThreshold } from './azure-threshold.js';
/**
* Filter configuration for Azure Content Safety.
* Filter configuration for Azure Content Safety
*/
export interface AzureContentSafety {
export type AzureContentSafety = {
Hate?: AzureThreshold;
SelfHarm?: AzureThreshold;
Sexual?: AzureThreshold;
Violence?: AzureThreshold;
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { FilteringConfig } from './filtering-config.js';
/**
* Representation of the 'FilteringModuleConfig' schema.
*/
export interface FilteringModuleConfig {
export type FilteringModuleConfig = {
/**
* List of provider type and filters.
*/
Expand All @@ -16,4 +16,4 @@ export interface FilteringModuleConfig {
* List of provider type and filters.
*/
output?: FilteringConfig;
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import type { MaskingProviderConfig } from './masking-provider-config.js';
/**
* Representation of the 'MaskingModuleConfig' schema.
*/
export interface MaskingModuleConfig {
export type MaskingModuleConfig = {
/**
* List of masking service providers
* Min Items: 1.
*/
masking_providers: MaskingProviderConfig[];
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ import type { LlmChoice } from './llm-choice.js';
/**
* Results of each module.
*/
export interface ModuleResults {
grounding?: GenericModuleResult;
export type ModuleResults = {
templating?: ChatMessages;
input_masking?: GenericModuleResult;
input_filtering?: GenericModuleResult;
llm?: LlmModuleResult;
output_filtering?: GenericModuleResult;
output_unmasking?: LlmChoice[];
}
};

0 comments on commit 6fe32b8

Please sign in to comment.