Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Composer/packages/server/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ const { createConfig } = require('@botframework-composer/test-utils');

module.exports = createConfig('server', 'node', {
setupFiles: [path.resolve(__dirname, 'src/__tests__/setupEnv.ts')],
testPathIgnorePatterns: ['src/__tests__/setupEnv.ts', 'orchestratorBuilder'],
testPathIgnorePatterns: ['src/__tests__/setupEnv.ts'],
});
1 change: 0 additions & 1 deletion Composer/packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"@microsoft/bf-dispatcher": "^4.11.0-beta.20201016.393c6b2",
"@microsoft/bf-generate-library": "^4.10.0-daily.20201026.178799",
"@microsoft/bf-lu": "^4.11.0-dev.20201013.7ccb128",
"@microsoft/bf-orchestrator": "4.11.0-beta.20201013.20d7917",
"archiver": "^5.0.2",
"axios": "^0.19.2",
"azure-storage": "^2.10.3",
Expand Down
16 changes: 0 additions & 16 deletions Composer/packages/server/src/models/bot/__mocks__/mockLUInput.json

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion Composer/packages/server/src/models/bot/botProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ export class BotProject implements IBotProject {
try {
const defaultBotProjectFile: any = await AssetService.manager.botProjectFileTemplate;

for (const [, file] of files) {
for (const [_, file] of files) {
if (file.name.endsWith(FileExtensions.BotProject)) {
return fileList;
}
Expand Down
56 changes: 0 additions & 56 deletions Composer/packages/server/src/models/bot/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@
import { FileInfo, IConfig } from '@bfc/shared';
import { ComposerReservoirSampler } from '@microsoft/bf-dispatcher/lib/mathematics/sampler/ComposerReservoirSampler';
import { ComposerBootstrapSampler } from '@microsoft/bf-dispatcher/lib/mathematics/sampler/ComposerBootstrapSampler';
import { Orchestrator } from '@microsoft/bf-orchestrator';

import { Path } from '../../utility/path';
import { IFileStorage } from '../storage/interface';
import log from '../../logger';

import { IOrchestratorBuildOutput, IOrchestratorNLRList, IOrchestratorProgress } from './interface';
import { luImportResolverGenerator, getLUFiles, getQnAFiles } from './luResolver';

// eslint-disable-next-line @typescript-eslint/no-var-requires
const crossTrainer = require('@microsoft/bf-lu/lib/parser/cross-train/crossTrainer.js');
const luBuild = require('@microsoft/bf-lu/lib/parser/lubuild/builder.js');
const qnaBuild = require('@microsoft/bf-lu/lib/parser/qnabuild/builder.js');
Expand Down Expand Up @@ -103,59 +100,6 @@ export class Builder {
this._locale = v;
}

/**
* Orchestrator: Get available list of NLR models
*/
public async runOrchestratorNlrList(): Promise<IOrchestratorNLRList> {
return JSON.parse(await Orchestrator.nlrListAsync());
}

/**
* Orchestrator: Download an available NLR model.
*
* @remarks Available NLR models and VersionIds are obtained by running runOrchestratorNlrList first.
*
* @param modelPath - Folder path to save NLR model
* @param nlrId - VersionId of the model
* @param onProgress - Callback to notify of D/L progress
* @param onFinish - Callback to notify of D/L completed
*/
public async runOrchestratorNlrGet(
modelPath: string,
nlrId: string,
onProgress: IOrchestratorProgress,
onFinish: IOrchestratorProgress
): Promise<void> {
await Orchestrator.nlrGetAsync(modelPath, nlrId, onProgress, onFinish);
}

/**
* Orchestrator: Build command to compile .lu files into Binary LU (.blu) snapshots.
*
* A snapshot (.blu file) is created per .lu supplied
*
* @param files - Array of FileInfo
* @param modelPath - Path to NLR model folder
* @param isDialog - Flag to toggle creation of Recognizer Dialogs (default: true)
* @param fullEmbedding - Use larger embeddings and skip size optimization (default: false)
* @returns An object containing snapshot bytes and recognizer dialogs for each .lu file
*/
public async runOrchestratorBuild(
files: FileInfo[],
modelPath: string,
isDialog = true,
fullEmbedding = false
): Promise<IOrchestratorBuildOutput> {
const luObjects = files
.filter((fi) => fi.name.endsWith('.lu'))
.map((fi) => ({
id: fi.name,
content: fi.content,
}));

return await Orchestrator.buildAsync(modelPath, luObjects, isDialog, null, fullEmbedding);
}

private async createGeneratedDir() {
// clear previous folder
await this.deleteDir(this.generatedFolderPath);
Expand Down
32 changes: 1 addition & 31 deletions Composer/packages/server/src/models/bot/interface.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { BaseSchema, ILuisConfig, IQnAConfig } from '@bfc/shared';
import { ILuisConfig, IQnAConfig } from '@bfc/shared';

import { CrossTrainConfig } from './builder';
import { RecognizerTypes } from './recognizer';
Expand Down Expand Up @@ -48,33 +48,3 @@ export interface IOperationLUFile {
export interface ILuisStatusOperation {
[key: string]: IOperationLUFile;
}

export interface IOrchestratorNLRList {
version: string;
readonly models: {
[versionId: string]: {
releaseDate: string;
description: string;
};
};
}

export interface IOrchestratorProgress {
(status: string): void;
}

export interface IOrchestratorRecognizer extends BaseSchema {
modelPath: string;
snapshotPath: string;
entityRecognizers: any[];
}

export interface IOrchestratorBuildOutput {
outputs: [{ id: string; snapshot: Uint8Array; recognizer: { [recog: string]: BaseSchema } }];
settings: {
orchestrator: {
modelPath: string;
snapshots: Map<string, string>;
};
};
}
Loading