@coveo/quantic 3.36.5 → 3.36.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +34 -9
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/agents/answer-agent/answer-agent-runner.d.ts +14 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/agents/answer-agent/answer-agent.d.ts +9 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/agents/answer-agent/head-answer-strategy.d.ts +6 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/agents/endpoint-url-builder.d.ts +5 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/agents/follow-up-agent/follow-up-agent.d.ts +9 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/agents/follow-up-agent/follow-up-answer-strategy.d.ts +6 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/endpoints/answer/answer-endpoint.d.ts +1 -69
- package/force-app/main/default/staticresources/coveoheadless/definitions/app/listener-middleware/generate-answer-listener-middleware.d.ts +8 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/generated-answer/headless-core-generated-answer.d.ts +54 -11
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/generated-answer/headless-generated-answer.d.ts +3 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/knowledge/generated-answer/headless-generated-answer-with-follow-ups.d.ts +17 -5
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/configuration/configuration-selectors.d.ts +9 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/follow-up-answers/follow-up-answers-actions.d.ts +31 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-actions.d.ts +15 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-analytics-actions.d.ts +15 -10
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-state.d.ts +14 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/sse-generated-answer-errors.d.ts +14 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/index.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/headless.js +36 -11
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +35 -10
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +33 -8
- package/package.json +2 -2
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Dispatch } from '@reduxjs/toolkit';
|
|
2
|
+
import type { NavigatorContext } from '../../../../../app/navigator-context-provider.js';
|
|
3
|
+
import { type StateNeededForHeadAnswerParams } from '../../../../../features/generated-answer/generated-answer-request.js';
|
|
4
|
+
/**
|
|
5
|
+
* Creates an AnswerRunner responsible for executing and managing
|
|
6
|
+
* the lifecycle of an AnswerAgent.
|
|
7
|
+
*
|
|
8
|
+
* The runner ensures that only one agent runs at a time.
|
|
9
|
+
* If a new run is triggered, any currently running agent is aborted.
|
|
10
|
+
*/
|
|
11
|
+
export declare const createAnswerRunner: () => {
|
|
12
|
+
run: (state: StateNeededForHeadAnswerParams, dispatch: Dispatch, getNavigatorContext: () => NavigatorContext) => Promise<void>;
|
|
13
|
+
abortRun: () => void;
|
|
14
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HttpAgent, type RunAgentInput } from '@ag-ui/client';
|
|
2
|
+
import type { PlatformEnvironment } from '../../../../../utils/url-utils.js';
|
|
3
|
+
/**
|
|
4
|
+
* Custom HTTP Agent for answer requests
|
|
5
|
+
*/
|
|
6
|
+
export declare class AnswerAgent extends HttpAgent {
|
|
7
|
+
protected requestInit(input: RunAgentInput): RequestInit;
|
|
8
|
+
}
|
|
9
|
+
export declare const createAnswerAgent: (agentId: string, organizationId: string, env: PlatformEnvironment) => AnswerAgent;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AgentSubscriber } from '@ag-ui/client';
|
|
2
|
+
import type { Dispatch } from '@reduxjs/toolkit';
|
|
3
|
+
/**
|
|
4
|
+
* Creates an AgentSubscriber that handles answer streaming events
|
|
5
|
+
*/
|
|
6
|
+
export declare const createHeadAnswerStrategy: (dispatch: Dispatch) => AgentSubscriber;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PlatformEnvironment } from '../../../../utils/url-utils.js';
|
|
2
|
+
/**
|
|
3
|
+
* Builds the base URL for answer generation requests based on the agent ID, organization ID, and environment.
|
|
4
|
+
*/
|
|
5
|
+
export declare const buildBaseAnswerGenerationUrl: (agentId: string, organizationId: string, environment: PlatformEnvironment) => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HttpAgent, type RunAgentInput } from '@ag-ui/client';
|
|
2
|
+
import type { PlatformEnvironment } from '../../../../../utils/url-utils.js';
|
|
3
|
+
/**
|
|
4
|
+
* Custom HTTP Agent for follow-up answer requests
|
|
5
|
+
*/
|
|
6
|
+
export declare class FollowUpAgent extends HttpAgent {
|
|
7
|
+
protected requestInit(input: RunAgentInput): RequestInit;
|
|
8
|
+
}
|
|
9
|
+
export declare const createFollowUpAgent: (agentId: string, organizationId: string, env: PlatformEnvironment) => FollowUpAgent;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AgentSubscriber } from '@ag-ui/client';
|
|
2
|
+
import type { Dispatch } from '@reduxjs/toolkit';
|
|
3
|
+
/**
|
|
4
|
+
* Creates an AgentSubscriber that handles follow-up answer streaming events
|
|
5
|
+
*/
|
|
6
|
+
export declare const createFollowUpStrategy: (dispatch: Dispatch) => AgentSubscriber;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AnyFacetRequest } from '../../../../../features/facets/generic/interfaces/generic-facet-request.js';
|
|
2
2
|
import type { AnalyticsParam, PipelineRuleParameters } from '../../../../search/search-api-params.js';
|
|
3
|
-
import { type
|
|
3
|
+
import { type GeneratedAnswerServerState } from '../../answer-generation-api-state.js';
|
|
4
4
|
/**
|
|
5
5
|
* Parameters for answer generation requests.
|
|
6
6
|
*/
|
|
@@ -28,71 +28,3 @@ export declare const answerEndpoint: import("@reduxjs/toolkit/query").Api<import
|
|
|
28
28
|
* Initiates an answer generation query with the specified strategy and parameters.
|
|
29
29
|
*/
|
|
30
30
|
export declare const initiateAnswerEndpoint: (args: AnswerEndpointArgs) => import("redux-thunk").ThunkAction<import("@reduxjs/toolkit/query").QueryActionCreatorResult<import("@reduxjs/toolkit/query").QueryDefinition<AnswerEndpointArgs, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {} & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GeneratedAnswerServerState, "answerGenerationApi">>, any, any, import("@reduxjs/toolkit").UnknownAction>;
|
|
31
|
-
/**
|
|
32
|
-
* Selects the cached answer generation data for the specified query parameters from the state.
|
|
33
|
-
*
|
|
34
|
-
* @param args - The answer endpoint arguments including strategy and parameters.
|
|
35
|
-
* @param state - The current answer generation API state.
|
|
36
|
-
* @returns The cached answer generation query result.
|
|
37
|
-
*/
|
|
38
|
-
export declare const selectAnswer: (args: AnswerEndpointArgs, state: AnswerGenerationApiState) => ({
|
|
39
|
-
status: import("@reduxjs/toolkit/query").QueryStatus.uninitialized;
|
|
40
|
-
originalArgs?: undefined | undefined;
|
|
41
|
-
data?: undefined | undefined;
|
|
42
|
-
error?: undefined | undefined;
|
|
43
|
-
requestId?: undefined | undefined;
|
|
44
|
-
endpointName?: string | undefined;
|
|
45
|
-
startedTimeStamp?: undefined | undefined;
|
|
46
|
-
fulfilledTimeStamp?: undefined | undefined;
|
|
47
|
-
} & {
|
|
48
|
-
status: import("@reduxjs/toolkit/query").QueryStatus.uninitialized;
|
|
49
|
-
isUninitialized: true;
|
|
50
|
-
isLoading: false;
|
|
51
|
-
isSuccess: false;
|
|
52
|
-
isError: false;
|
|
53
|
-
}) | ({
|
|
54
|
-
status: import("@reduxjs/toolkit/query").QueryStatus.fulfilled;
|
|
55
|
-
error: undefined;
|
|
56
|
-
requestId: string;
|
|
57
|
-
originalArgs: AnswerEndpointArgs;
|
|
58
|
-
endpointName: string;
|
|
59
|
-
startedTimeStamp: number;
|
|
60
|
-
data: GeneratedAnswerServerState;
|
|
61
|
-
fulfilledTimeStamp: number;
|
|
62
|
-
} & {
|
|
63
|
-
status: import("@reduxjs/toolkit/query").QueryStatus.fulfilled;
|
|
64
|
-
isUninitialized: false;
|
|
65
|
-
isLoading: false;
|
|
66
|
-
isSuccess: true;
|
|
67
|
-
isError: false;
|
|
68
|
-
}) | ({
|
|
69
|
-
status: import("@reduxjs/toolkit/query").QueryStatus.pending;
|
|
70
|
-
originalArgs: AnswerEndpointArgs;
|
|
71
|
-
requestId: string;
|
|
72
|
-
data?: GeneratedAnswerServerState | undefined;
|
|
73
|
-
error?: import("@reduxjs/toolkit/query").FetchBaseQueryError | import("@reduxjs/toolkit").SerializedError | undefined;
|
|
74
|
-
endpointName: string;
|
|
75
|
-
startedTimeStamp: number;
|
|
76
|
-
fulfilledTimeStamp?: number | undefined;
|
|
77
|
-
} & {
|
|
78
|
-
status: import("@reduxjs/toolkit/query").QueryStatus.pending;
|
|
79
|
-
isUninitialized: false;
|
|
80
|
-
isLoading: true;
|
|
81
|
-
isSuccess: false;
|
|
82
|
-
isError: false;
|
|
83
|
-
}) | ({
|
|
84
|
-
status: import("@reduxjs/toolkit/query").QueryStatus.rejected;
|
|
85
|
-
data?: GeneratedAnswerServerState | undefined;
|
|
86
|
-
requestId: string;
|
|
87
|
-
fulfilledTimeStamp?: number | undefined;
|
|
88
|
-
originalArgs: AnswerEndpointArgs;
|
|
89
|
-
endpointName: string;
|
|
90
|
-
startedTimeStamp: number;
|
|
91
|
-
error: import("@reduxjs/toolkit/query").FetchBaseQueryError | import("@reduxjs/toolkit").SerializedError;
|
|
92
|
-
} & {
|
|
93
|
-
status: import("@reduxjs/toolkit/query").QueryStatus.rejected;
|
|
94
|
-
isUninitialized: false;
|
|
95
|
-
isLoading: false;
|
|
96
|
-
isSuccess: false;
|
|
97
|
-
isError: true;
|
|
98
|
-
});
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
export declare const
|
|
1
|
+
import { type Dispatch } from '@reduxjs/toolkit';
|
|
2
|
+
import type { StateNeededForHeadAnswerParams } from '../../features/generated-answer/generated-answer-request.js';
|
|
3
|
+
import type { NavigatorContext } from '../navigator-context-provider.js';
|
|
4
|
+
export declare const createGenerateAnswerListener: (extra: {
|
|
5
|
+
getNavigatorContext: () => NavigatorContext;
|
|
6
|
+
}) => import("@reduxjs/toolkit").ListenerMiddlewareInstance<StateNeededForHeadAnswerParams, Dispatch<import("@reduxjs/toolkit").UnknownAction>, {
|
|
7
|
+
getNavigatorContext: () => NavigatorContext;
|
|
8
|
+
}>;
|
|
@@ -21,12 +21,24 @@ export interface GeneratedAnswer extends Controller {
|
|
|
21
21
|
retry(): void;
|
|
22
22
|
/**
|
|
23
23
|
* Indicates that the generated answer met the user expectations.
|
|
24
|
+
* @deprecated The no-argument `like` method is deprecated and will be removed in a future major version. The method will now take a required `answerId` parameter to specify which answer is being liked, and will log the like action with the provided `answerId` for analytics.
|
|
24
25
|
*/
|
|
25
26
|
like(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Indicates that the generated answer met the user expectations.
|
|
29
|
+
* @param answerId - Answer Id of the liked answer.
|
|
30
|
+
*/
|
|
31
|
+
like(answerId: string): void;
|
|
26
32
|
/**
|
|
27
33
|
* Marks the generated answer as not relevant to the end user.
|
|
34
|
+
* @deprecated The no-argument `dislike` method is deprecated and will be removed in a future major version. The method will now take a required `answerId` parameter to specify which answer is being disliked, and will log the dislike action with the provided `answerId` for analytics.
|
|
28
35
|
*/
|
|
29
36
|
dislike(): void;
|
|
37
|
+
/**
|
|
38
|
+
* Marks the generated answer as not relevant to the end user.
|
|
39
|
+
* @param answerId - Answer Id of the disliked answer.
|
|
40
|
+
*/
|
|
41
|
+
dislike(answerId: string): void;
|
|
30
42
|
/**
|
|
31
43
|
* Opens the modal to provide feedback about why the generated answer was not relevant.
|
|
32
44
|
*/
|
|
@@ -40,11 +52,6 @@ export interface GeneratedAnswer extends Controller {
|
|
|
40
52
|
* @param feedback - The feedback that the end user wishes to send.
|
|
41
53
|
*/
|
|
42
54
|
sendFeedback(feedback: GeneratedAnswerFeedback): void;
|
|
43
|
-
/**
|
|
44
|
-
* Logs a custom event indicating a cited source link was clicked.
|
|
45
|
-
* @param id - The ID of the clicked citation.
|
|
46
|
-
*/
|
|
47
|
-
logCitationClick(id: string): void;
|
|
48
55
|
/**
|
|
49
56
|
* Displays the generated answer.
|
|
50
57
|
*/
|
|
@@ -71,24 +78,60 @@ export interface GeneratedAnswer extends Controller {
|
|
|
71
78
|
disable(): void;
|
|
72
79
|
/**
|
|
73
80
|
* Logs a custom event indicating the generated answer was copied to the clipboard.
|
|
81
|
+
* @deprecated The `logCopyToClipboard` method is deprecated and will be removed in a future major version. The method will now take a required `answerId` parameter to specify which answer is being copied, and will log the copy action with the provided `answerId` for analytics.
|
|
74
82
|
*/
|
|
75
83
|
logCopyToClipboard(): void;
|
|
76
84
|
/**
|
|
77
|
-
* Logs a custom event indicating
|
|
85
|
+
* Logs a custom event indicating the generated answer was copied to the clipboard.
|
|
86
|
+
* @param answerId - Answer Id of the copied answer.
|
|
87
|
+
*/
|
|
88
|
+
logCopyToClipboard(answerId: string): void;
|
|
89
|
+
/**
|
|
90
|
+
* Logs a custom event indicating a cited source link was clicked.
|
|
91
|
+
* @param citationId - The ID of the clicked citation.
|
|
92
|
+
* @deprecated The `logCitationClick` method is deprecated and will be removed in a future major version. The method will now take a required `answerId` parameter to specify which answer is being clicked, and will log the click action with the provided `answerId` for analytics.
|
|
93
|
+
*/
|
|
94
|
+
logCitationClick(citationId: string): void;
|
|
95
|
+
/**
|
|
96
|
+
* Logs a custom event indicating a cited source link was clicked.
|
|
78
97
|
* @param citationId - The ID of the clicked citation.
|
|
98
|
+
* @param answerId - Answer Id of the clicked citation's answer.
|
|
99
|
+
*/
|
|
100
|
+
logCitationClick(citationId: string, answerId: string): void;
|
|
101
|
+
/**
|
|
102
|
+
* Logs a custom event indicating a cited source link was hovered.
|
|
103
|
+
* @param citationId - The ID of the hovered citation.
|
|
79
104
|
* @param citationHoverTimeMs - The number of milliseconds spent hovering over the citation.
|
|
105
|
+
* @deprecated The `logCitationHover` method is deprecated and will be removed in a future major version. The method will now take a required `answerId` parameter to specify which answer is being hovered, and will log the hover action with the provided `answerId` for analytics.
|
|
80
106
|
*/
|
|
81
107
|
logCitationHover(citationId: string, citationHoverTimeMs: number): void;
|
|
108
|
+
/**
|
|
109
|
+
* Logs a custom event indicating a cited source link was hovered.
|
|
110
|
+
* @param citationId - The ID of the hovered citation.
|
|
111
|
+
* @param citationHoverTimeMs - The number of milliseconds spent hovering over the citation.
|
|
112
|
+
* @param answerId - Answer Id of the hovered citation's answer.
|
|
113
|
+
*/
|
|
114
|
+
logCitationHover(citationId: string, citationHoverTimeMs: number, answerId: string): void;
|
|
82
115
|
}
|
|
83
116
|
export interface GeneratedAnswerAnalyticsClient {
|
|
84
|
-
|
|
85
|
-
|
|
117
|
+
/** @deprecated */
|
|
118
|
+
logLikeGeneratedAnswer(): CustomAction;
|
|
119
|
+
logLikeGeneratedAnswer(answerId?: string): CustomAction;
|
|
120
|
+
/** @deprecated */
|
|
121
|
+
logDislikeGeneratedAnswer(): CustomAction;
|
|
122
|
+
logDislikeGeneratedAnswer(answerId?: string): CustomAction;
|
|
86
123
|
logGeneratedAnswerFeedback: (feedback: GeneratedAnswerFeedback) => CustomAction;
|
|
87
|
-
|
|
88
|
-
|
|
124
|
+
/** @deprecated */
|
|
125
|
+
logOpenGeneratedAnswerSource(citationId: string): CustomAction;
|
|
126
|
+
logOpenGeneratedAnswerSource(citationId: string, answerId?: string): CustomAction;
|
|
127
|
+
/** @deprecated */
|
|
128
|
+
logHoverCitation(citationId: string, citationHoverTimeMs: number): CustomAction;
|
|
129
|
+
logHoverCitation(citationId: string, citationHoverTimeMs: number, answerId?: string): CustomAction;
|
|
89
130
|
logGeneratedAnswerShowAnswers: () => CustomAction;
|
|
90
131
|
logGeneratedAnswerHideAnswers: () => CustomAction;
|
|
91
|
-
|
|
132
|
+
/** @deprecated */
|
|
133
|
+
logCopyGeneratedAnswer(): CustomAction;
|
|
134
|
+
logCopyGeneratedAnswer(answerId?: string): CustomAction;
|
|
92
135
|
logRetryGeneratedAnswer: () => LegacySearchAction;
|
|
93
136
|
logGeneratedAnswerExpand: () => CustomAction;
|
|
94
137
|
logGeneratedAnswerCollapse: () => CustomAction;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { GeneratedAnswerCitation } from '../../api/generated-answer/generated-answer-event-payload.js';
|
|
2
2
|
import type { SearchEngine } from '../../app/search-engine/search-engine.js';
|
|
3
|
-
import type { GeneratedAnswerBase, GeneratedAnswerState } from '../../features/generated-answer/generated-answer-state.js';
|
|
3
|
+
import type { GeneratedAnswerBase, GeneratedAnswerState, GenerationStep, GenerationStepName } from '../../features/generated-answer/generated-answer-state.js';
|
|
4
4
|
import type { GeneratedResponseFormat } from '../../features/generated-answer/generated-response-format.js';
|
|
5
5
|
import type { GeneratedAnswer, GeneratedAnswerProps, GeneratedAnswerPropsInitialState } from '../core/generated-answer/headless-core-generated-answer.js';
|
|
6
|
-
import { type GeneratedAnswerWithFollowUps } from '../knowledge/generated-answer/headless-generated-answer-with-follow-ups.js';
|
|
7
|
-
export type { GeneratedAnswerCitation, GeneratedResponseFormat, GeneratedAnswerState, GeneratedAnswer, GeneratedAnswerWithFollowUps, GeneratedAnswerBase, GeneratedAnswerProps, GeneratedAnswerPropsInitialState, };
|
|
6
|
+
import { type GeneratedAnswerWithFollowUps, type GeneratedAnswerWithFollowUpsState } from '../knowledge/generated-answer/headless-generated-answer-with-follow-ups.js';
|
|
7
|
+
export type { GeneratedAnswerCitation, GeneratedResponseFormat, GeneratedAnswerState, GeneratedAnswer, GeneratedAnswerWithFollowUps, GeneratedAnswerWithFollowUpsState, GeneratedAnswerBase, GeneratedAnswerProps, GeneratedAnswerPropsInitialState, GenerationStep, GenerationStepName, };
|
|
8
8
|
/**
|
|
9
9
|
* Creates a `GeneratedAnswer` controller instance.
|
|
10
10
|
|
|
@@ -3,7 +3,7 @@ import type { SearchEngine } from '../../../app/search-engine/search-engine.js';
|
|
|
3
3
|
import type { FollowUpAnswersState } from '../../../features/follow-up-answers/follow-up-answers-state.js';
|
|
4
4
|
import type { GeneratedAnswerState } from '../../../index.js';
|
|
5
5
|
import { type GeneratedAnswer, type GeneratedAnswerAnalyticsClient, type GeneratedAnswerProps } from '../../core/generated-answer/headless-core-generated-answer.js';
|
|
6
|
-
interface GeneratedAnswerWithFollowUpsState extends GeneratedAnswerState {
|
|
6
|
+
export interface GeneratedAnswerWithFollowUpsState extends GeneratedAnswerState {
|
|
7
7
|
followUpAnswers: FollowUpAnswersState;
|
|
8
8
|
}
|
|
9
9
|
export interface GeneratedAnswerWithFollowUps extends GeneratedAnswer {
|
|
@@ -13,17 +13,30 @@ export interface GeneratedAnswerWithFollowUps extends GeneratedAnswer {
|
|
|
13
13
|
state: GeneratedAnswerWithFollowUpsState;
|
|
14
14
|
/**
|
|
15
15
|
* Marks the answer as liked.
|
|
16
|
-
* @param answerId - Optional ID of the answer to like. Defaults to the
|
|
16
|
+
* @param answerId - Optional ID of the answer to like. Defaults to the first answer.
|
|
17
17
|
*/
|
|
18
18
|
like(answerId?: string): void;
|
|
19
19
|
/**
|
|
20
20
|
* Marks the answer as disliked.
|
|
21
|
-
* @param answerId - Optional ID of the answer to dislike. Defaults to the
|
|
21
|
+
* @param answerId - Optional ID of the answer to dislike. Defaults to the first answer.
|
|
22
22
|
*/
|
|
23
23
|
dislike(answerId?: string): void;
|
|
24
|
+
/**
|
|
25
|
+
* Logs a custom event indicating a cited source link was hovered.
|
|
26
|
+
* @param citationId - The ID of the hovered citation.
|
|
27
|
+
* @param citationHoverTimeMs - The number of milliseconds spent hovering over the citation.
|
|
28
|
+
* @param answerId - Optional ID of the answer for which the citation was hovered. Defaults to the first answer.
|
|
29
|
+
*/
|
|
30
|
+
logCitationHover(citationId: string, citationHoverTimeMs: number, answerId?: string): void;
|
|
31
|
+
/**
|
|
32
|
+
* Logs a click on a cited source link for analytics.
|
|
33
|
+
* @param citationId - The ID of the clicked citation.
|
|
34
|
+
* @param answerId - Optional ID of the answer for which the citation was clicked. Defaults to the first answer.
|
|
35
|
+
*/
|
|
36
|
+
logCitationClick(citationId: string, answerId?: string): void;
|
|
24
37
|
/**
|
|
25
38
|
* Logs a copy-to-clipboard interaction for analytics.
|
|
26
|
-
* @param answerId - Optional ID of the copied answer. Defaults to the
|
|
39
|
+
* @param answerId - Optional ID of the copied answer. Defaults to the first answer.
|
|
27
40
|
*/
|
|
28
41
|
logCopyToClipboard(answerId?: string): void;
|
|
29
42
|
/**
|
|
@@ -44,4 +57,3 @@ export type GeneratedAnswerWithFollowUpsProps = GeneratedAnswerProps & Required<
|
|
|
44
57
|
* @returns A `GeneratedAnswerWithFollowUps` controller instance.
|
|
45
58
|
*/
|
|
46
59
|
export declare function buildGeneratedAnswerWithFollowUps(engine: SearchEngine | InsightEngine, analyticsClient: GeneratedAnswerAnalyticsClient, props: GeneratedAnswerWithFollowUpsProps): GeneratedAnswerWithFollowUps;
|
|
47
|
-
export {};
|
|
@@ -5,6 +5,15 @@ export declare const selectLocale: (state: {
|
|
|
5
5
|
export declare const selectTimezone: (state: {
|
|
6
6
|
configuration: ConfigurationState;
|
|
7
7
|
}) => string;
|
|
8
|
+
export declare const selectAccessToken: (state: {
|
|
9
|
+
configuration: ConfigurationState;
|
|
10
|
+
}) => string;
|
|
11
|
+
export declare const selectOrganizationId: (state: {
|
|
12
|
+
configuration: ConfigurationState;
|
|
13
|
+
}) => string;
|
|
14
|
+
export declare const selectEnvironment: (state: {
|
|
15
|
+
configuration: ConfigurationState;
|
|
16
|
+
}) => "dev" | "stg" | "hipaa" | "prod";
|
|
8
17
|
/**
|
|
9
18
|
* Selects the agent ID from the knowledge configuration.
|
|
10
19
|
* Used for agent-based answer generation via the Agent API.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { GeneratedAnswerCitation } from '../../api/generated-answer/generated-answer-event-payload.js';
|
|
2
2
|
import type { SearchThunkExtraArguments } from '../../app/search-thunk-extra-arguments.js';
|
|
3
|
+
import { type GenerationStepName } from '../generated-answer/generated-answer-state.js';
|
|
3
4
|
import type { GeneratedContentFormat } from '../generated-answer/generated-response-format.js';
|
|
4
5
|
import { type StateNeededForFollowUpAnswerParams } from './follow-up-answer-request.js';
|
|
5
6
|
export declare const setIsEnabled: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: boolean], boolean, "followUpAnswers/setIsEnabled", never, never>;
|
|
@@ -24,6 +25,13 @@ export declare const setFollowUpIsLoading: import("@reduxjs/toolkit").ActionCrea
|
|
|
24
25
|
answerId: string;
|
|
25
26
|
isLoading: boolean;
|
|
26
27
|
}, "followUpAnswers/setFollowUpIsLoading", never, never>;
|
|
28
|
+
export declare const setFollowUpIsStreaming: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: {
|
|
29
|
+
answerId: string;
|
|
30
|
+
isStreaming: boolean;
|
|
31
|
+
}], {
|
|
32
|
+
answerId: string;
|
|
33
|
+
isStreaming: boolean;
|
|
34
|
+
}, "followUpAnswers/setFollowUpIsStreaming", never, never>;
|
|
27
35
|
export declare const followUpMessageChunkReceived: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: {
|
|
28
36
|
answerId: string;
|
|
29
37
|
textDelta: string;
|
|
@@ -54,6 +62,11 @@ export declare const followUpFailed: import("@reduxjs/toolkit").ActionCreatorWit
|
|
|
54
62
|
message?: string;
|
|
55
63
|
code?: number;
|
|
56
64
|
}, "followUpAnswers/followUpFailed", never, never>;
|
|
65
|
+
export declare const activeFollowUpStartFailed: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: {
|
|
66
|
+
message?: string;
|
|
67
|
+
}], {
|
|
68
|
+
message?: string;
|
|
69
|
+
}, "followUpAnswers/activeFollowUpStartFailed", never, never>;
|
|
57
70
|
export declare const likeFollowUp: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: {
|
|
58
71
|
answerId: string;
|
|
59
72
|
}], {
|
|
@@ -70,6 +83,24 @@ export declare const submitFollowUpFeedback: import("@reduxjs/toolkit").ActionCr
|
|
|
70
83
|
answerId: string;
|
|
71
84
|
}, "followUpAnswers/submitFollowUpFeedback", never, never>;
|
|
72
85
|
export declare const resetFollowUpAnswers: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"followUpAnswers/resetFollowUpAnswers">;
|
|
86
|
+
export declare const followUpStepStarted: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: {
|
|
87
|
+
answerId: string;
|
|
88
|
+
name: GenerationStepName;
|
|
89
|
+
startedAt: number;
|
|
90
|
+
}], {
|
|
91
|
+
answerId: string;
|
|
92
|
+
name: GenerationStepName;
|
|
93
|
+
startedAt: number;
|
|
94
|
+
}, "followUpAnswers/stepStarted", never, never>;
|
|
95
|
+
export declare const followUpStepFinished: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: {
|
|
96
|
+
answerId: string;
|
|
97
|
+
name: GenerationStepName;
|
|
98
|
+
finishedAt: number;
|
|
99
|
+
}], {
|
|
100
|
+
answerId: string;
|
|
101
|
+
name: GenerationStepName;
|
|
102
|
+
finishedAt: number;
|
|
103
|
+
}, "followUpAnswers/stepFinished", never, never>;
|
|
73
104
|
export declare const generateFollowUpAnswer: import("@reduxjs/toolkit").AsyncThunk<void, string, {
|
|
74
105
|
state: StateNeededForFollowUpAnswerParams;
|
|
75
106
|
extra: SearchThunkExtraArguments;
|
|
@@ -4,6 +4,7 @@ import type { StreamAnswerAPIState } from '../../api/knowledge/stream-answer-api
|
|
|
4
4
|
import type { SearchThunkExtraArguments } from '../../app/search-thunk-extra-arguments.js';
|
|
5
5
|
import type { AnswerApiQueryParams, StateNeededForHeadAnswerParams } from '../../features/generated-answer/generated-answer-request.js';
|
|
6
6
|
import type { ConfigurationSection, DebugSection, GeneratedAnswerSection, SearchSection } from '../../state/state-sections.js';
|
|
7
|
+
import { type GenerationStepName } from './generated-answer-state.js';
|
|
7
8
|
import { type GeneratedResponseFormat } from './generated-response-format.js';
|
|
8
9
|
type StateNeededByGeneratedAnswerStream = ConfigurationSection & SearchSection & GeneratedAnswerSection & DebugSection;
|
|
9
10
|
export declare const citationSchema: {
|
|
@@ -47,6 +48,20 @@ export declare const registerFieldsToIncludeInCitations: import("@reduxjs/toolki
|
|
|
47
48
|
export declare const setIsAnswerGenerated: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: boolean], boolean, "generatedAnswer/setIsAnswerGenerated", never, never>;
|
|
48
49
|
export declare const setCannotAnswer: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: boolean], boolean, "generatedAnswer/setCannotAnswer", never, never>;
|
|
49
50
|
export declare const setAnswerApiQueryParams: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: Partial<AnswerApiQueryParams>], unknown, "generatedAnswer/setAnswerApiQueryParams", never, never>;
|
|
51
|
+
export declare const startStep: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: {
|
|
52
|
+
name: GenerationStepName;
|
|
53
|
+
startedAt: number;
|
|
54
|
+
}], {
|
|
55
|
+
name: GenerationStepName;
|
|
56
|
+
startedAt: number;
|
|
57
|
+
}, "generatedAnswer/startStep", never, never>;
|
|
58
|
+
export declare const finishStep: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: {
|
|
59
|
+
name: GenerationStepName;
|
|
60
|
+
finishedAt: number;
|
|
61
|
+
}], {
|
|
62
|
+
name: GenerationStepName;
|
|
63
|
+
finishedAt: number;
|
|
64
|
+
}, "generatedAnswer/finishStep", never, never>;
|
|
50
65
|
interface StreamAnswerArgs {
|
|
51
66
|
setAbortControllerRef: (ref: AbortController) => void;
|
|
52
67
|
}
|
|
@@ -12,10 +12,14 @@ export type GeneratedAnswerFeedback = {
|
|
|
12
12
|
};
|
|
13
13
|
export declare const parseEvaluationDetails: (detail: "yes" | "no" | "unknown") => boolean | undefined;
|
|
14
14
|
export declare const logRetryGeneratedAnswer: () => LegacySearchAction;
|
|
15
|
-
export declare
|
|
16
|
-
export declare
|
|
17
|
-
export declare
|
|
18
|
-
export declare
|
|
15
|
+
export declare function logOpenGeneratedAnswerSource(citationId: string): CustomAction;
|
|
16
|
+
export declare function logOpenGeneratedAnswerSource(citationId: string, answerId: string): CustomAction;
|
|
17
|
+
export declare function logHoverCitation(citationId: string, citationHoverTimeInMs: number): CustomAction;
|
|
18
|
+
export declare function logHoverCitation(citationId: string, citationHoverTimeInMs: number, answerId: string): CustomAction;
|
|
19
|
+
export declare function logLikeGeneratedAnswer(): CustomAction;
|
|
20
|
+
export declare function logLikeGeneratedAnswer(answerId: string): CustomAction;
|
|
21
|
+
export declare function logDislikeGeneratedAnswer(): CustomAction;
|
|
22
|
+
export declare function logDislikeGeneratedAnswer(answerId: string): CustomAction;
|
|
19
23
|
export declare const logGeneratedAnswerFeedback: (feedback: GeneratedAnswerFeedback) => CustomAction;
|
|
20
24
|
export declare const logGeneratedAnswerStreamEnd: (answerGenerated: boolean) => CustomAction;
|
|
21
25
|
export declare const logGeneratedAnswerResponseLinked: () => CustomAction;
|
|
@@ -23,18 +27,19 @@ export declare const logGeneratedAnswerShowAnswers: () => CustomAction;
|
|
|
23
27
|
export declare const logGeneratedAnswerHideAnswers: () => CustomAction;
|
|
24
28
|
export declare const logGeneratedAnswerExpand: () => CustomAction;
|
|
25
29
|
export declare const logGeneratedAnswerCollapse: () => CustomAction;
|
|
26
|
-
export declare
|
|
30
|
+
export declare function logCopyGeneratedAnswer(): CustomAction;
|
|
31
|
+
export declare function logCopyGeneratedAnswer(answerId: string): CustomAction;
|
|
27
32
|
export declare const retryGeneratedAnswer: () => SearchAction;
|
|
28
33
|
export declare const generatedAnswerAnalyticsClient: {
|
|
29
|
-
logCopyGeneratedAnswer:
|
|
34
|
+
logCopyGeneratedAnswer: typeof logCopyGeneratedAnswer;
|
|
30
35
|
logGeneratedAnswerHideAnswers: () => CustomAction;
|
|
31
36
|
logGeneratedAnswerShowAnswers: () => CustomAction;
|
|
32
37
|
logGeneratedAnswerStreamEnd: (answerGenerated: boolean) => CustomAction;
|
|
33
38
|
logGeneratedAnswerFeedback: (feedback: GeneratedAnswerFeedback) => CustomAction;
|
|
34
|
-
logDislikeGeneratedAnswer:
|
|
35
|
-
logLikeGeneratedAnswer:
|
|
36
|
-
logHoverCitation:
|
|
37
|
-
logOpenGeneratedAnswerSource:
|
|
39
|
+
logDislikeGeneratedAnswer: typeof logDislikeGeneratedAnswer;
|
|
40
|
+
logLikeGeneratedAnswer: typeof logLikeGeneratedAnswer;
|
|
41
|
+
logHoverCitation: typeof logHoverCitation;
|
|
42
|
+
logOpenGeneratedAnswerSource: typeof logOpenGeneratedAnswerSource;
|
|
38
43
|
logRetryGeneratedAnswer: () => LegacySearchAction;
|
|
39
44
|
logGeneratedAnswerExpand: () => CustomAction;
|
|
40
45
|
logGeneratedAnswerCollapse: () => CustomAction;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import type { GeneratedAnswerCitation } from '../../api/generated-answer/generated-answer-event-payload.js';
|
|
2
2
|
import type { AnswerApiQueryParams } from '../../features/generated-answer/generated-answer-request.js';
|
|
3
3
|
import type { GeneratedContentFormat, GeneratedResponseFormat } from './generated-response-format.js';
|
|
4
|
+
type GenerationStepStatus = 'active' | 'completed';
|
|
5
|
+
export type GenerationStepName = (typeof GENERATION_STEP_NAMES)[number];
|
|
6
|
+
export declare const GENERATION_STEP_NAMES: readonly ["searching", "thinking", "answering"];
|
|
7
|
+
export interface GenerationStep {
|
|
8
|
+
name: GenerationStepName;
|
|
9
|
+
status: GenerationStepStatus;
|
|
10
|
+
startedAt: number;
|
|
11
|
+
finishedAt?: number;
|
|
12
|
+
}
|
|
4
13
|
/**
|
|
5
14
|
* Base interface for generated answer structures.
|
|
6
15
|
* Contains core properties shared across different generated answer implementations.
|
|
@@ -54,6 +63,10 @@ export interface GeneratedAnswerBase {
|
|
|
54
63
|
* Determines if the generated answer feedback was submitted.
|
|
55
64
|
*/
|
|
56
65
|
feedbackSubmitted: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* The list of steps involved in generating the answer, along with their status and timestamps.
|
|
68
|
+
*/
|
|
69
|
+
generationSteps: GenerationStep[];
|
|
57
70
|
}
|
|
58
71
|
/**
|
|
59
72
|
* A scoped and simplified part of the headless state that is relevant to the `GeneratedAnswer` component.
|
|
@@ -103,3 +116,4 @@ export interface GeneratedAnswerState extends GeneratedAnswerBase {
|
|
|
103
116
|
isAnswerGenerated: boolean;
|
|
104
117
|
}
|
|
105
118
|
export declare function getGeneratedAnswerInitialState(): GeneratedAnswerState;
|
|
119
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enumeration of error codes for Server-Sent Events (SSE) related to generated answers.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum GeneratedAnswerSseErrorCode {
|
|
5
|
+
SseMaxDurationExceeded = 1000,
|
|
6
|
+
SseFollowUpNotSupported = 1001,
|
|
7
|
+
ConversationNotFound = 1002,
|
|
8
|
+
SseModelsNotAvailable = 1003,
|
|
9
|
+
SseInternalError = 1004
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Maps backend error codes to frontend error codes for generated answer SSE errors.
|
|
13
|
+
*/
|
|
14
|
+
export declare function mapRunErrorCode(code?: string): GeneratedAnswerSseErrorCode;
|
|
@@ -63,7 +63,7 @@ export type { FieldSuggestions, FieldSuggestionsOptions, FieldSuggestionsProps,
|
|
|
63
63
|
export { buildFieldSuggestions } from './controllers/field-suggestions/facet/headless-field-suggestions.js';
|
|
64
64
|
export type { FoldedCollection, FoldedResult, FoldedResultList, FoldedResultListOptions, FoldedResultListProps, FoldedResultListState, FoldingOptions, } from './controllers/folded-result-list/headless-folded-result-list.js';
|
|
65
65
|
export { buildFoldedResultList } from './controllers/folded-result-list/headless-folded-result-list.js';
|
|
66
|
-
export type { GeneratedAnswer, GeneratedAnswerBase, GeneratedAnswerCitation, GeneratedAnswerProps, GeneratedAnswerPropsInitialState, GeneratedAnswerState, GeneratedAnswerWithFollowUps, GeneratedResponseFormat, } from './controllers/generated-answer/headless-generated-answer.js';
|
|
66
|
+
export type { GeneratedAnswer, GeneratedAnswerBase, GeneratedAnswerCitation, GeneratedAnswerProps, GeneratedAnswerPropsInitialState, GeneratedAnswerState, GeneratedAnswerWithFollowUps, GeneratedAnswerWithFollowUpsState, GeneratedResponseFormat, GenerationStep, GenerationStepName, } from './controllers/generated-answer/headless-generated-answer.js';
|
|
67
67
|
export { buildGeneratedAnswer } from './controllers/generated-answer/headless-generated-answer.js';
|
|
68
68
|
export type { InteractiveCitation, InteractiveCitationOptions, InteractiveCitationProps, } from './controllers/generated-answer/headless-interactive-citation.js';
|
|
69
69
|
export { buildInteractiveCitation } from './controllers/generated-answer/headless-interactive-citation.js';
|