Skip to content

[DERCBOT-1329] Support filtering for Annotations + refined Dialogs filters#1845

Merged
Benvii merged 12 commits intofeature/annotation-anomaly/DERCBOT-1309from
feature/annotation-filter/DERCBOT-1329
Mar 27, 2025
Merged

[DERCBOT-1329] Support filtering for Annotations + refined Dialogs filters#1845
Benvii merged 12 commits intofeature/annotation-anomaly/DERCBOT-1309from
feature/annotation-filter/DERCBOT-1329

Conversation

@scezen
Copy link
Member

@scezen scezen commented Feb 12, 2025

Ticket : DERCBOT-1329

🏷️ New Filters for Annotations

Added new filters in DialogsSearchQuery and DialogReportQuery, allowing filtering by:

  • annotationStates → Filter dialogs by annotation states (e.g., "RESOLVED", "ANOMALY").
  • annotationReasons → Filter by annotation reasons (e.g., "HALLUCINATION", "INCOMPLETE_SOURCES").
  • annotationSort → Sort annotations by lastUpdateDate (ASC or DESC).
  • annotationCreationDateFrom / annotationCreationDateTo → Filter annotations by creation date range.
  • withAnnotations → Boolean flag to retrieve only dialogs with annotations.

💬 Enhanced Dialogs Filtering

New filters to refine dialog search results:

⚠️ There is no direct creationDate for a dialog, so we use the creation date of the first action in the dialog.

  • dialogSort → Sort dialogs by creation date (ASC or DESC).
  • dialogCreationDateFrom / dialogCreationDateTo → Filter dialogs by creation date range

🔍 Example Query with All New Filters

{
    "namespace": "app",
    "applicationName": "testingfeature",
    "language": "fr",
    "start": 0,
    "size": 99999,
    "playerId": null,
    "dialogId": null,
    "withAnnotations": true,
    "annotationStates": ["RESOLVED", "ANOMALY"],
    "annotationReasons": ["INCOMPLETE_SOURCES"],
    "annotationSort": "DESC",
    "dialogSort": "ASC",
    "annotationCreationDateFrom": "2025-02-06T00:00:00.000Z",
    "annotationCreationDateTo": "2025-02-07T23:59:59.999Z",
    "dialogCreationDateFrom": "2025-02-07T00:00:00.000Z",
    "dialogCreationDateTo": "2025-02-08T00:00:00.000Z"
}

@scezen scezen changed the base branch from master to feature/annotation-anomaly/DERCBOT-1309 February 12, 2025 15:58
@scezen scezen marked this pull request as ready for review February 14, 2025 14:39
@scezen scezen changed the title Support filtering for Annotations + refined Dialogs filters [DERCBOT-1329] Support filtering for Annotations + refined Dialogs filters Feb 17, 2025
Copy link
Contributor

@assouktim assouktim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few small changes.

@scezen scezen changed the base branch from feature/annotation-anomaly/DERCBOT-1309 to master March 20, 2025 16:19
@scezen scezen changed the base branch from master to feature/annotation-anomaly/DERCBOT-1309 March 20, 2025 16:22
@scezen scezen changed the base branch from feature/annotation-anomaly/DERCBOT-1309 to master March 20, 2025 16:28
@scezen scezen changed the base branch from master to feature/annotation-anomaly/DERCBOT-1309 March 20, 2025 16:29
Copy link
Member

@Benvii Benvii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks good work 👍️

@scezen scezen force-pushed the feature/annotation-anomaly/DERCBOT-1309 branch from 9dfcebf to 67a76ca Compare March 27, 2025 13:56
@Benvii Benvii force-pushed the feature/annotation-anomaly/DERCBOT-1309 branch from 67a76ca to 9dfcebf Compare March 27, 2025 14:02
@Benvii Benvii merged commit 3c0d261 into feature/annotation-anomaly/DERCBOT-1309 Mar 27, 2025
Benvii pushed a commit that referenced this pull request Mar 27, 2025
Adding modifications

Typo

[DERCBOT-1309] Documentation update + Annotation Model

Move Model files + Add Annotation as a subdocument of an Action

Update Action and Dialog to support single annotation per action

DAO update to allow Annotation insertion in Action subdocument

Initiate BotAnnotationEvent as emptyList

Business logic + Annotation creation endpoint

Model update, refacto and addEvent endpoint logic

Update and Delete event endpoint

Restore removed byStory endpoint

DialogsVerticle + Annotation presence check

Improvements

Dialog Endpoints to DialogVerticle

Update logic to retrieve annotations from /dialogs/search endpoint

Modify annotation with PUT endpoint

lastUpdateDate logic added

Unused import

Fix malfunctioning logic + Doc update

Add initial event at annotation creation

PR Review

Rebase + fix

canEdit bool

Refacto and BotAnnotationUpdateDTO delete

Doc update with latest endpoints

Annotation on dialogs endpoint + canEdit logic fix

namespace & botId check for annotation endpoints

annotationId logic removal + doc & endpoint update

Fix canEdit logic on updateAnnotation & updateAnnotationEvent

[DERCBOT-1329] Support filtering for Annotations + refined Dialogs filters (#1845)

* withAnnotations bool

* [DERCBOT-1329] Fix annotation filter

* Filter by annotation presence, by cumulative state, by cumulative reason

* Sort by annotation lastUpdateDate

* Filters addition

* Filtering by dialog creationDate & sort by ASC/DESC order

* FaqSettings files

* Single POST endpoint for creation/update of an annotation

* pr fix

* Revert "FaqSettings files"

This reverts commit 21fb259.

* rollback on FaqSettings

* rollback on FaqSettings V2

---------

Co-authored-by: Mohamed ASSOUKTI <mohamed.assoukti@partnre.com>
scezen added a commit that referenced this pull request Mar 28, 2025
Adding modifications

Typo

[DERCBOT-1309] Documentation update + Annotation Model

Move Model files + Add Annotation as a subdocument of an Action

Update Action and Dialog to support single annotation per action

DAO update to allow Annotation insertion in Action subdocument

Initiate BotAnnotationEvent as emptyList

Business logic + Annotation creation endpoint

Model update, refacto and addEvent endpoint logic

Update and Delete event endpoint

Restore removed byStory endpoint

DialogsVerticle + Annotation presence check

Improvements

Dialog Endpoints to DialogVerticle

Update logic to retrieve annotations from /dialogs/search endpoint

Modify annotation with PUT endpoint

lastUpdateDate logic added

Unused import

Fix malfunctioning logic + Doc update

Add initial event at annotation creation

PR Review

Rebase + fix

canEdit bool

Refacto and BotAnnotationUpdateDTO delete

Doc update with latest endpoints

Annotation on dialogs endpoint + canEdit logic fix

namespace & botId check for annotation endpoints

annotationId logic removal + doc & endpoint update

Fix canEdit logic on updateAnnotation & updateAnnotationEvent

[DERCBOT-1329] Support filtering for Annotations + refined Dialogs filters (#1845)

* withAnnotations bool

* [DERCBOT-1329] Fix annotation filter

* Filter by annotation presence, by cumulative state, by cumulative reason

* Sort by annotation lastUpdateDate

* Filters addition

* Filtering by dialog creationDate & sort by ASC/DESC order

* FaqSettings files

* Single POST endpoint for creation/update of an annotation

* pr fix

* Revert "FaqSettings files"

This reverts commit 21fb259.

* rollback on FaqSettings

* rollback on FaqSettings V2

---------

Co-authored-by: Mohamed ASSOUKTI <mohamed.assoukti@partnre.com>
Benvii pushed a commit that referenced this pull request Mar 28, 2025
…#1824)

* [DERCBOT-1314] Documentation

Adding modifications

Typo

[DERCBOT-1309] Documentation update + Annotation Model

Move Model files + Add Annotation as a subdocument of an Action

Update Action and Dialog to support single annotation per action

DAO update to allow Annotation insertion in Action subdocument

Initiate BotAnnotationEvent as emptyList

Business logic + Annotation creation endpoint

Model update, refacto and addEvent endpoint logic

Update and Delete event endpoint

Restore removed byStory endpoint

DialogsVerticle + Annotation presence check

Improvements

Dialog Endpoints to DialogVerticle

Update logic to retrieve annotations from /dialogs/search endpoint

Modify annotation with PUT endpoint

lastUpdateDate logic added

Unused import

Fix malfunctioning logic + Doc update

Add initial event at annotation creation

PR Review

Rebase + fix

canEdit bool

Refacto and BotAnnotationUpdateDTO delete

Doc update with latest endpoints

Annotation on dialogs endpoint + canEdit logic fix

namespace & botId check for annotation endpoints

annotationId logic removal + doc & endpoint update

Fix canEdit logic on updateAnnotation & updateAnnotationEvent

[DERCBOT-1329] Support filtering for Annotations + refined Dialogs filters (#1845)

* withAnnotations bool

* [DERCBOT-1329] Fix annotation filter

* Filter by annotation presence, by cumulative state, by cumulative reason

* Sort by annotation lastUpdateDate

* Filters addition

* Filtering by dialog creationDate & sort by ASC/DESC order

* FaqSettings files

* Single POST endpoint for creation/update of an annotation

* pr fix

* Revert "FaqSettings files"

This reverts commit 21fb259.

* rollback on FaqSettings

* rollback on FaqSettings V2

---------

Co-authored-by: Mohamed ASSOUKTI <mohamed.assoukti@partnre.com>

* Small fix

---------

Co-authored-by: Mohamed ASSOUKTI <mohamed.assoukti@partnre.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants