UNPKG

@lableb/javascript-sdk

Version:

Lableb cloud search client for javascript

69 lines (58 loc) 3.06 kB
import { BaseRequestParams, BuildRequestResult } from "../../types"; import { RecommendFeedbackDocument } from "../feedback/feedback.document.type"; export interface BatchRecommendFeedbackRequestParams extends Omit<BaseRequestParams, "sessionId" | "userId" | "userIp" | "userCountry" | "sessionIdGenerator"> { /** your recommend API Key copied from [Lableb Dashboard](https://dashboard.lableb.com) */ APIKey?: string, /** the used recommend handler for the recommend function */ recommendHandler?: string, /** * feedback object * * ## Content of the feedback object: `documentFeedback` * * | field | type | description | * | ----------- | ------ | ----------- | * | sourceId* | string | Source data Id that is used to fetch the recommendations | * | sourceTitle | string | Source data Title that is used to fetch the recommendations | * | sourceUrl | string | Source data URL that is used to fetch the recommendations | * | targetId* | string | Target data Id that"s the end-user interact with | * | targetTitle | string | Target data Title that"s the end-user interact with | * | targetUrl | string | Target data URL that"s the end-user interact with | * | itemOrder | string | document"s order clicked on or chosen by the user | * | sessionId | string | uniques session id of the end user | * | userId | string | end user id | * | userIp | string | end user IP address | * | userCountry | string | end user country code(ISO-3166) | */ documentsFeedbacks: RecommendFeedbackDocument[], } export interface SingleRecommendFeedbackRequestParams extends Omit<BatchRecommendFeedbackRequestParams, "documentsFeedbacks"> { /** * feedback object * * ## Content of the feedback object: `documentFeedback` * * | field | type | description | * | ----------- | ------ | ----------- | * | sourceId* | string | Source data Id that is used to fetch the recommendations | * | sourceTitle | string | Source data Title that is used to fetch the recommendations | * | sourceUrl | string | Source data URL that is used to fetch the recommendations | * | targetId* | string | Target data Id that"s the end-user interact with | * | targetTitle | string | Target data Title that"s the end-user interact with | * | targetUrl | string | Target data URL that"s the end-user interact with | * | itemOrder | string | document"s order clicked on or chosen by the user | * | sessionId | string | uniques session id of the end user | * | userId | string | end user id | * | userIp | string | end user IP address | * | userCountry | string | end user country code(ISO-3166) | */ documentFeedback: RecommendFeedbackDocument, } export interface BatchRecommendFeedbackRequestResult extends BuildRequestResult { params: { apikey?: string, }, body: RecommendFeedbackDocument[], }