-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(MLX): add Semantic search preview (#772)
* feat(MLX): add ses/preview * fix: descriptions * fix: add export document.js * fix: add Interface for Document and change SES
- Loading branch information
1 parent
2e60355
commit 4dc7e3c
Showing
7 changed files
with
81 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type DocumentRequirementStatus = 'OK' | 'INSUFFICIENT_DOCUMENTS' | 'NB_OF_DOCUMENTS_OVER_LIMIT'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/resources/MachineLearning/SemanticSearchConfiguration/SemanticSearchConfiguration.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import API from '../../../APICore.js'; | ||
import Resource from '../../Resource.js'; | ||
import { | ||
SemanticSearchDocumentGroupPreview, | ||
SemanticSearchDocumentGroupPreviewParams, | ||
} from './SemanticSearchConfigurationInterfaces.js'; | ||
|
||
export default class SemanticSearchConfiguration extends Resource { | ||
static baseUrl = `/rest/organizations/${API.orgPlaceholder}/machinelearning/configuration/ses`; | ||
static previewUrl = `${SemanticSearchConfiguration.baseUrl}/preview`; | ||
|
||
preview(params: SemanticSearchDocumentGroupPreviewParams) { | ||
return this.api.post<SemanticSearchDocumentGroupPreview>(SemanticSearchConfiguration.previewUrl, params); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
...rces/MachineLearning/SemanticSearchConfiguration/SemanticSearchConfigurationInterfaces.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import {DocumentRequirementStatus} from '../DocumentInterfaces.js'; | ||
import {FilterConditions} from '../FilterConditions.js'; | ||
|
||
export interface SemanticSearchDocumentGroupPreviewParams { | ||
/** | ||
* The names of the sources containing the items that the model should use to extract chunks. | ||
*/ | ||
sources?: string[]; | ||
/** | ||
* The custom filter conditions to target specific documents. | ||
*/ | ||
filterConditions?: FilterConditions[]; | ||
/** | ||
* The query that determines the documents to extract. Cannot be used with other document extraction parameters, e.g. sources, filter conditions, etc. | ||
* | ||
* @Example @source==("My source") AND @permanentid AND @language="English"; | ||
*/ | ||
advancedQuery?: string; | ||
} | ||
|
||
export interface SemanticSearchDocumentGroupPreview { | ||
/** | ||
* 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 maximum number of documents allowed to learn from. | ||
*/ | ||
documentLimit: number; | ||
/** | ||
* Status for the number of required documents to build the model. | ||
*/ | ||
documentRequirementStatus: DocumentRequirementStatus; | ||
} |
2 changes: 2 additions & 0 deletions
2
src/resources/MachineLearning/SemanticSearchConfiguration/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './SemanticSearchConfiguration.js'; | ||
export * from './SemanticSearchConfigurationInterfaces.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
export * from './MachineLearning.js'; | ||
export * from './MachineLearningInterfaces.js'; | ||
export * from './FilterConditions.js'; | ||
export * from './DocumentInterfaces.js'; | ||
export * from './Models/index.js'; | ||
export * from './ModelInformation/index.js'; | ||
export * from './ModelListing/index.js'; | ||
export * from './DNEConfiguration/index.js'; | ||
export * from './CaseClassificationConfiguration/index.js'; | ||
export * from './SmartSnippetsConfiguration/index.js'; | ||
export * from './PQSConfiguration/index.js'; | ||
export * from './SemanticSearchConfiguration/index.js'; | ||
export * from './IAPRConfiguration/index.js'; | ||
export * from './UserActionHistoryConfiguration/index.js'; |