Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(headless): creation of the new headless insight user actions controller #4192

Merged
merged 11 commits into from
Jul 22, 2024

Conversation

mmitiche
Copy link
Contributor

@mmitiche mmitiche commented Jul 16, 2024

SFINT-5613

Overview about the user actions feature:

The user actions feature allows the agent using the Insight Panel to check all the actions that have beed made by a user who created a case, these knowledge about the actions performed by the user should help the agent to understand the context of the case and issue the user is facing and help him solve the case more quickly.

From a UI perspective, that's what this feature look like:
Screenshot 2024-07-16 at 9 21 10 AM

From where we get the user actions data:

We get the user action data from the the following machine learning API: /rest/organizations/{organizationId}/machinelearning/user/actions

Example request:

curl -X 'POST' \
  'https://platform.cloud.coveo.com/rest/organizations/MyOrgId/machinelearning/user/actions' \
  -H 'accept: */*' \
  -H 'Authorization: Bearer XXXXXXX' \
  -H 'Content-Type: application/json' \
  -d '{
  "objectId": "MyUserId"
}'

Example response:

{
   "executionTime":0.011054937,
   "modelSubType":"userActionHistory",
   "modelType":"Profile",
   "responseTime":1721136841424,
   "value":[
      {
         "name":"SEARCH",
         "value":"{\"cause\":\"userActionLoad\",\"origin_level_1\":\"coveoLightningInsightPanel\",\"origin_level_2\":\"default\"}",
         "time":"1721012966908"
      },
      {
         "name":"CUSTOM",
         "value":"{\"event_type\":\"User Actions\",\"event_value\":\"openUserActions\",\"origin_level_1\":\"coveoLightningInsightPanel\",\"origin_level_2\":\"default\"}",
         "time":"1721012966186"
      },
     ....
   ]

What is being done in the Headless library:

In this first iteration(this PR):

  • Created the Headless user actions controller.
  • Created the Headless user actions dispatchable actions.
  • Created the Headless user actions slice.
  • Created the Headless user actions state.
  • Updated the the insight API client to target the correct user actions endpoint.
  • Unit tests created.

In a future iteration(a following PR):

  • Will add the logic that preprocess the data returned by the API, this logic will organize and filter the data to make it ready to display by the future UI components: https://coveord.atlassian.net/browse/SFINT-5639
  • Expose the Headless user actions controller.
  • Add the and expose the headless user action actions loader.
  • Add more unit tests.

@developer-experience-bot
Copy link
Contributor

developer-experience-bot bot commented Jul 16, 2024

Pull Request Report

PR Title

✅ Title follows the conventional commit spec.

Live demo links

Bundle Size

File Old (kb) New (kb) Change (%)
case-assist 244.9 245.1 0.1
commerce 341.4 341.6 0.1
search 413.5 413.7 0
insight 392.3 392.5 0.1
product-listing 306.9 307.1 0.1
product-recommendation 211.2 211.4 0.1
recommendation 258 258.2 0.1
ssr 404.8 405 0

SSR Progress

Use case SSR (#) CSR (#) Progress (%)
search 39 44 89
recommendation 0 4 0
product-recommendation 0 10 0
product-listing 0 13 0
case-assist 0 6 0
insight 0 27 0
commerce 0 15 0
Detailed logs search : buildInteractiveResult
search : buildInteractiveInstantResult
search : buildInteractiveRecentResult
search : buildInteractiveCitation
search : buildGeneratedAnswer
recommendation : missing SSR support
product-recommendation : missing SSR support
product-listing : missing SSR support
case-assist : missing SSR support
insight : missing SSR support
commerce : missing SSR support

Copy link
Member

@olamothe olamothe left a comment

Choose a reason for hiding this comment

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

Code looks 👍 , but I have some doubts about the userId parameter.

Copy link
Contributor

@alexprudhomme alexprudhomme left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@SimonMilord SimonMilord left a comment

Choose a reason for hiding this comment

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

GG!

@mmitiche mmitiche added this pull request to the merge queue Jul 22, 2024
Merged via the queue into master with commit b52953e Jul 22, 2024
106 of 116 checks passed
@mmitiche mmitiche deleted the SFINT-5613 branch July 22, 2024 16:31
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