Skip to content

Commit

Permalink
feat(ml)!: Enforce trackingIds parameter in the creation of PQS and I…
Browse files Browse the repository at this point in the history
…APR model (#762)

feat(ml): enforce trackingIds parameter in the creation of PQS and IAPR model

BREAKING CHANGE: For creation of PQS / IAPR models, trackingIds will be a mandatory parameter to be
included
  • Loading branch information
JTangCoveo authored Nov 13, 2023
1 parent 96c6ba9 commit f5ddbca
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,10 @@ export interface IAPRConfigurationModel {
* The model display name in the Coveo Administration console.
*/
modelDisplayName: string;
/**
* The trackingIds that usage analytics events must contain for the model to use those events in its learning process. The model will use an event if it contains at least one of the specified IDs
*
* @Example: [ "sport" ]
*/
trackingIds: string[];
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ describe('IAPRConfiguration', () => {
const model: IAPRConfigurationModel = {
modelDisplayName: 'kiki soudane',
catalogId: 'catalog_mock',
trackingIds: ['sport'],
};
iaprConfig.create(model);
expect(api.post).toHaveBeenCalledTimes(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,10 @@ export interface PQSConfigurationModel {
* The filter to apply to the 'Click' and 'Search' event dimensions of the UA data to learn from when rebuilding the model.
*/
searchEventFilter?: string;
/**
* The trackingIds that usage analytics events must contain for the model to use those events in its learning process. The model will use an event if it contains at least one of the specified IDs
*
* @Example: [ "sport" ]
*/
trackingIds: string[];
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ describe('PQSConfiguration', () => {

describe('createPQSModel', () => {
it('should make a POST call to the specific PQSConfiguration url', () => {
const model: PQSConfigurationModel = {modelDisplayName: 'kiki soudane', catalogId: 'sekia'};
const model: PQSConfigurationModel = {
modelDisplayName: 'kiki soudane',
catalogId: 'sekia',
trackingIds: ['sport'],
};
pqsConfig.createPQSModel(model);
expect(api.post).toHaveBeenCalledTimes(1);
expect(api.post).toHaveBeenCalledWith(`${PQSConfiguration.baseUrl}/model`, model);
Expand Down

0 comments on commit f5ddbca

Please sign in to comment.