Skip to content

Commit

Permalink
feat(MLX): add ses/preview
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgerold committed Nov 17, 2023
1 parent 2e60355 commit ccb6040
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/resources/MachineLearning/Document.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type DocumentRequirementStatus = 'OK' | 'INSUFFICIENT_DOCUMENTS' | 'NB_OF_DOCUMENTS_OVER_LIMIT';
12 changes: 12 additions & 0 deletions src/resources/MachineLearning/SESConfiguration/SESConfiguration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import API from '../../../APICore.js';
import Resource from '../../Resource.js';
import {SESDocumentGroupPreviewParams, SESDocumentGroupPreview} from './SESConfigurationInterfaces.js';

export default class SESConfiguration extends Resource {
static baseUrl = `/rest/organizations/${API.orgPlaceholder}/machinelearning/configuration/ses`;
static previewUrl = `${SESConfiguration.baseUrl}/preview`;

preview(params: SESDocumentGroupPreviewParams) {
return this.api.post<SESDocumentGroupPreview>(SESConfiguration.previewUrl, params);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import {DocumentRequirementStatus} from '../Document.js';
import {FilterConditions} from '../FilterConditions.js';

export interface SESDocumentGroupPreviewParams {
/**
* The sources to consider.
*/
sources: string[];
/**
* An array of filtering conditions.
*/
filterConditions: FilterConditions[];
/**
* The query that determines the documents to extract
*/
advancedQuery: string;
}

export interface SESDocumentGroupPreview {
/**
* The query that was used to fetch document information.
*
* @Example @source==("Salesforce Notifier")
*/
query: string;
/**
* The total number of documents in the selected sources.
*/
numberOfDocumentsInSources: number;
/**
* The number of documents that are candidates for learning.
*/
numberOfValidDocuments: number;
/**
* The number of documents in the selected sources that match the conditions.
*/
numberOfDocumentsInSourcesMatchingFilters: number;
/**
* The number of documents in the selected sources that match the conditions and have a permanentid
*/
numberOfDocumentsInSourcesMatchingFiltersWithPermanentId: number;
/**
* The limit of documents that are candidates for learning.
*/
documentLimit: number;
/**
* Status for the number of required documents to build the model.
*/
documentRequirementStatus: DocumentRequirementStatus;
}
2 changes: 2 additions & 0 deletions src/resources/MachineLearning/SESConfiguration/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './SESConfiguration.js';
export * from './SESConfigurationInterfaces.js';
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {DocumentRequirementStatus} from '../Document.js';
import {FilterConditions} from '../FilterConditions.js';

export interface DocumentType {
Expand Down Expand Up @@ -39,8 +40,6 @@ export interface SmartSnippetsConfigurationModel {
documentTypes?: DocumentType[];
}

export type SmartSnippetsDocumentRequirementStatus = 'OK' | 'INSUFFICIENT_DOCUMENTS' | 'NB_OF_DOCUMENTS_OVER_LIMIT';

export interface SmartSnippetsDocumentGroupPreviewParams {
/**
* The sources to consider.
Expand Down Expand Up @@ -94,7 +93,7 @@ export interface SmartSnippetsDocumentGroupPreview {
/**
* Status for the number of required documents to build the model.
*/
documentRequirementStatus: SmartSnippetsDocumentRequirementStatus;
documentRequirementStatus: DocumentRequirementStatus;
}

export interface SmartSnippetsContentFieldsParams {
Expand Down
1 change: 1 addition & 0 deletions src/resources/MachineLearning/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ export * from './DNEConfiguration/index.js';
export * from './CaseClassificationConfiguration/index.js';
export * from './SmartSnippetsConfiguration/index.js';
export * from './PQSConfiguration/index.js';
export * from './SESConfiguration/index.js';
export * from './IAPRConfiguration/index.js';
export * from './UserActionHistoryConfiguration/index.js';

0 comments on commit ccb6040

Please sign in to comment.