Skip to content

Commit

Permalink
fix: Remove grounding module related types (#270)
Browse files Browse the repository at this point in the history
* updates for non breaking changes

* compatibility notes

* fix

* updates

* remove compatibility notes

---------

Co-authored-by: Deeksha Sinha <[email protected]>
  • Loading branch information
jjtang1985 and deekshas8 authored Nov 7, 2024
1 parent a9c9d2e commit b850dc9
Show file tree
Hide file tree
Showing 17 changed files with 21 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { AzureContentSafety } from './azure-content-safety.js';
*/
export type AzureContentSafetyFilterConfig = {
/**
* String represents name of the filter provider.
* String represents name of the filter provider
* @example "azure_content_safety"
*/
type: 'azure_content_safety';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
*/

/**
* Representation of the 'AzureThreshold' schema.
* Threshold for the filter. Setting it to `0` blocks content with low severity, whereas `6` is the most permissive and blocks only the highest severity
*/
export type AzureThreshold = 0 | 2 | 4 | 6;
3 changes: 0 additions & 3 deletions packages/orchestration/src/client/api/schema/chat-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@ export type ChatMessage = {
* @example "user"
*/
role: string;
/**
* @example "What is SAP S/4HANA?"
*/
content: string;
} & Record<string, any>;
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ export type CompletionPostRequest = {
orchestration_config: OrchestrationConfig;
/**
* @example {
* "groundingInput": "What is SAP Joule?",
* "inputContext": "optimizing supply chain management"
* }
*/
input_params?: Record<string, string>;
/**
* History of chat messages. Can be used to provide system and assistant messages to set the context of the conversation. Will be merged with the template message.
* History of chat messages. Can be used to provide system and assistant messages to set the context of the conversation. Will be merged with the template message
*/
messages_history?: ChatMessages;
} & Record<string, any>;
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { LlmModuleResult } from './llm-module-result.js';
*/
export type CompletionPostResponse = {
/**
* ID of the request.
* ID of the request
* @example "d4a67ea1-2bf9-4df7-8105-d48203ccff76"
*/
request_id: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/orchestration/src/client/api/schema/dpi-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import type { DpiEntityConfig } from './dpi-entity-config.js';
*/
export type DpiConfig = {
/**
* Type of masking service provider.
* Type of masking service provider
*/
type: 'sap_data_privacy_integration';
/**
* Type of masking method to be used.
* Type of masking method to be used
*/
method: 'anonymization' | 'pseudonymization';
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

/**
* Default entities supported by data privacy and integration service.
* Default entities supported by data privacy and integration service
*/
export type DpiEntities =
| 'profile-person'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { DpiEntities } from './dpi-entities.js';
*/
export type DpiEntityConfig = {
/**
* Type of entity to be masked.
* Type of entity to be masked
*/
type: DpiEntities;
} & Record<string, any>;
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type ErrorResponse = {
*/
message: string;
/**
* Where the error occurred.
* Where the error occurred
* @example "LLM Module"
*/
location: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
*/

/**
* Generic module result.
* Generic module result
*/
export type GenericModuleResult = {
/**
* Some message created from the module.
* Some message created from the module
* @example "Input to LLM is masked successfully."
*/
message: string;
/**
* Additional data object from the module.
* Additional data object from the module
*/
data?: Record<string, any>;
} & Record<string, any>;
41 changes: 0 additions & 41 deletions packages/orchestration/src/client/api/schema/grounding-filter.ts

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions packages/orchestration/src/client/api/schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,4 @@ export * from './masking-provider-config.js';
export * from './dpi-config.js';
export * from './dpi-entity-config.js';
export * from './dpi-entities.js';
export * from './grounding-module-config.js';
export * from './grounding-filter.js';
export * from './error-response.js';
6 changes: 3 additions & 3 deletions packages/orchestration/src/client/api/schema/llm-choice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import type { ChatMessage } from './chat-message.js';
*/
export type LlmChoice = {
/**
* Index of the choice.
* Index of the choice
*/
index: number;
message: ChatMessage;
/**
* Log probabilities.
* Log probabilities
*/
logprobs?: Record<string, number[]>;
/**
* Reason the model stopped generating tokens. 'stop' if the model hit a natural stop point or a provided stop sequence, 'length' if the maximum token number was reached, 'content_filter' if content was omitted due to a filter enforced by the LLM model provider or the content filtering module.
* Reason the model stopped generating tokens. 'stop' if the model hit a natural stop point or a provided stop sequence, 'length' if the maximum token number was reached, 'content_filter' if content was omitted due to a filter enforced by the LLM model provider or the content filtering module
* @example "stop"
*/
finish_reason: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
*/
export type LlmModuleConfig = {
/**
* Model name as in LLM Access configuration.
* Model name as in LLM Access configuration
* @example "gpt-4"
*/
model_name: string;
/**
* Model parameters.
* Model parameters
* @example {
* "max_tokens": 300,
* "temperature": 0.1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import type { LlmModuleConfig } from './llm-module-config.js';
import type { TemplatingModuleConfig } from './templating-module-config.js';
import type { FilteringModuleConfig } from './filtering-module-config.js';
import type { MaskingModuleConfig } from './masking-module-config.js';
import type { GroundingModuleConfig } from './grounding-module-config.js';
/**
* Representation of the 'ModuleConfigs' schema.
*/
Expand All @@ -16,5 +15,4 @@ export type ModuleConfigs = {
templating_module_config: TemplatingModuleConfig;
filtering_module_config?: FilteringModuleConfig;
masking_module_config?: MaskingModuleConfig;
grounding_module_config?: GroundingModuleConfig;
} & Record<string, any>;
8 changes: 4 additions & 4 deletions packages/orchestration/src/client/api/schema/token-usage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
*/

/**
* Usage of tokens in the response.
* Usage of tokens in the response
*/
export type TokenUsage = {
/**
* Number of tokens used in the input.
* Number of tokens used in the input
* @example 20
*/
completion_tokens: number;
/**
* Number of tokens used in the output.
* Number of tokens used in the output
* @example 30
*/
prompt_tokens: number;
/**
* Total number of tokens used.
* Total number of tokens used
* @example 50
*/
total_tokens: number;
Expand Down

0 comments on commit b850dc9

Please sign in to comment.