Skip to content

Commit

Permalink
fix: Changes from lint
Browse files Browse the repository at this point in the history
  • Loading branch information
cloud-sdk-js committed Jan 10, 2025
1 parent 24885c9 commit 4d78c6a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 16 deletions.
3 changes: 2 additions & 1 deletion packages/orchestration/src/orchestration-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {
parseMockResponse
} from '../../../test-util/mock-http.js';
import { OrchestrationClient } from './orchestration-client.js';
import { buildAzureContentFilter,
import {
buildAzureContentFilter,
constructCompletionPostRequest,
constructCompletionPostRequestFromJsonModuleConfig
} from './orchestration-utils.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { constructCompletionPostRequest, buildAzureContentFilter } from './orchestration-utils.js';
import {
constructCompletionPostRequest,
buildAzureContentFilter
} from './orchestration-utils.js';
import type { CompletionPostRequest } from './client/api/schema/index.js';
import type {
OrchestrationModuleConfig,
Expand Down
27 changes: 17 additions & 10 deletions packages/orchestration/src/orchestration-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import { jest } from '@jest/globals';
import {
addStreamOptions,
addStreamOptionsToLlmModuleConfig,
addStreamOptionsToOutputFilteringConfig
, buildAzureContentFilter,
constructCompletionPostRequest } from './orchestration-utils.js';
addStreamOptionsToOutputFilteringConfig,
buildAzureContentFilter,
constructCompletionPostRequest
} from './orchestration-utils.js';
import type {
OrchestrationModuleConfig,
StreamOptions
} from './orchestration-types.js';
import type {
ModuleConfigs,
OrchestrationConfig
,
OrchestrationConfig,
CompletionPostRequest,
FilteringModuleConfig
} from './client/api/schema/index.js';
Expand Down Expand Up @@ -41,7 +41,9 @@ describe('construct completion post request', () => {
};

it('should add include_usage to llm module config', () => {
const llmConfig = addStreamOptionsToLlmModuleConfig(defaultOrchestrationModuleConfig.llm);
const llmConfig = addStreamOptionsToLlmModuleConfig(
defaultOrchestrationModuleConfig.llm
);
expect(llmConfig.model_params?.stream_options).toEqual({
include_usage: true
});
Expand All @@ -58,11 +60,16 @@ describe('construct completion post request', () => {
});

it('should not add any stream options to llm module config', () => {
const llmConfig = addStreamOptionsToLlmModuleConfig(defaultOrchestrationModuleConfig.llm, {
llm: null
});
const llmConfig = addStreamOptionsToLlmModuleConfig(
defaultOrchestrationModuleConfig.llm,
{
llm: null
}
);
expect(
Object.keys((llmConfig.model_params ?? {})).every(key => key !== 'stream_options')
Object.keys(llmConfig.model_params ?? {}).every(
key => key !== 'stream_options'
)
).toBe(true);
});

Expand Down
1 change: 0 additions & 1 deletion packages/orchestration/src/orchestration-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { createLogger } from '@sap-cloud-sdk/util';
import type {
AzureContentSafety,
InputFilteringConfig,

CompletionPostRequest,
FilteringStreamOptions,
ModuleConfigs,
Expand Down
4 changes: 1 addition & 3 deletions tests/type-tests/test/orchestration.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { expectError, expectType, expectAssignable } from 'tsd';
import {
OrchestrationClient
} from '@sap-ai-sdk/orchestration';
import { OrchestrationClient } from '@sap-ai-sdk/orchestration';
import type {
CompletionPostResponse,
OrchestrationResponse,
Expand Down

0 comments on commit 4d78c6a

Please sign in to comment.