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(genqa): add logCitationClick event #476

Merged
merged 3 commits into from
Oct 1, 2024
Merged

Conversation

jelmedini
Copy link
Contributor

@jelmedini jelmedini commented Sep 11, 2024

SVCC-4171 🚀

Proposed changes:

  • Add a new logGeneratedAnswerCitationClick event to Insight & search client
  • This new method should make the click event assume a document position of 1 .
  • The click event payload should look like this:
{
    "language": "en",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36",
    "collectionName": "default", -- Deprecated
    "documentAuthor": "unknown", -- Available in stream response?
    "documentPosition": 1,  -- Hardcoded to 1
    "documentTitle": "Relevance Generative Answering", -- In stream API response
    "documentUri": "https://levelup.coveo.com/learn/courses/relevance-generative-answering",  -- In stream API response as URI
    "documentUriHash": "bK2L18lxLvsUB5h4", - Depecreated
    "documentUrl": "https://levelup.coveo.com/learn/courses/relevance-generative-answering", -- In stream API response as Click URI
    "sourceName": "Level Up",   -- Needs to be added stream API response
    "queryPipeline": "Customer Zero Community search - RGA Update V3",
    "originContext": "buildersearchpage", -- Same as custom event
    "originLevel1": "Connect RGA V3 Testing", -- Same as custom event
    "originLevel2": "default", -- Same as custom event
    "originLevel3": "https://search.cloud.coveo.com/builder/", -- Same as custom event
    "customData": {
        "coveoHeadlessVersion": "2.78.0", -- Inherited
        "generativeQuestionAnsweringId": "queryStream01_coveosearch_1ffa0550-3d4b-4d09-9574-8c4225b1edf9",
--TO ADD"contentIDKey": "permanentid",
--TO ADD"contentIDValue": "29bd12f1-12fb-4ac4-9463-66e37a0cb686",
        "coveoAtomicVersion": "2.77.1" -- Inherited
--From Stream API"citationId": "42.20035$https://levelup.coveo.com/learn/courses/relevance-generative-answering-3541ae00-8d76-4b85-aa02-75478f4b6a6e",
    },
    "facetState": [],
    "anonymous": false,
    "clientId": "d4a6b215-241a-40f2-ad82-4890895843ad",
    "actionCause": "openGeneratedAnswerSource", -- New actionCause
    "searchQueryUid": "6549c762-4b4d-466d-ba16-bfe3b8d21928" -- From search event
}

How to test

Checklist:

  • Unit tests and/or functional tests are written and cover the proposed changes ❗
  • The proposed change can't affect any current customer implementation that could lead to events being rejected from our APIs or events to be miscategorized by UA.

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.

Nice 👌

Copy link
Contributor

@erocheleau erocheleau left a comment

Choose a reason for hiding this comment

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

There's a bit of an issue with the typing of the required data for the citationClick DocumentInfo

src/insight/insightClient.ts Show resolved Hide resolved
Copy link
Contributor

@mmitiche mmitiche left a comment

Choose a reason for hiding this comment

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

LGTM ✅
Just a small test that can be improved.

src/insight/insightClient.spec.ts Show resolved Hide resolved
@jelmedini jelmedini merged commit fba02a7 into master Oct 1, 2024
4 checks passed
@jelmedini jelmedini deleted the feature/SVCC-4171 branch October 1, 2024 11:58
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.

7 participants