@coveo/quantic 3.30.3-pre.e6f28bdc7a → 3.30.3-pre.f0f33d2cd7
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 +8 -8
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/stream-answer-api.d.ts +9 -7
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/search/search-api-params.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-actions.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-mocks.d.ts +209 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-request.d.ts +44 -73
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-state.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/insight-search/insight-search-actions.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/search/legacy/search-request.d.ts +1 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/search/search-request.d.ts +1 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/test/mock-search-request.d.ts +1 -3
- package/force-app/main/default/staticresources/coveoheadless/headless.js +10 -10
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +9 -9
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +7 -7
- package/package.json +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/knowledge/generated-answer/headless-answerapi-generated-answer-mocks.d.ts +0 -8318
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/knowledge/generated-answer/utils/testingUtils.d.ts +0 -8
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import type { ThunkDispatch, UnknownAction } from '@reduxjs/toolkit';
|
|
2
|
+
import type { AnswerApiQueryParams } from '../../features/generated-answer/generated-answer-request.js';
|
|
2
3
|
import type { EventSourceMessage } from '../../utils/fetch-event-source/parse.js';
|
|
3
|
-
import type { SearchRequest } from '../search/search/search-request.js';
|
|
4
4
|
import type { GeneratedAnswerStream } from './generated-answer-stream.js';
|
|
5
5
|
import type { StreamAnswerAPIState } from './stream-answer-api-state.js';
|
|
6
6
|
export declare const updateCacheWithEvent: (event: EventSourceMessage, draft: GeneratedAnswerStream, dispatch: ThunkDispatch<StreamAnswerAPIState, unknown, UnknownAction>) => void;
|
|
7
7
|
export declare const answerApi: import("@reduxjs/toolkit/query").Api<import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {} & import("@reduxjs/toolkit/query").RetryOptions, {}>, {
|
|
8
|
-
getAnswer: import("@reduxjs/toolkit/query").QueryDefinition<
|
|
8
|
+
getAnswer: import("@reduxjs/toolkit/query").QueryDefinition<AnswerApiQueryParams, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {} & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GeneratedAnswerStream, "answer">;
|
|
9
9
|
}, "answer", never, typeof import("@reduxjs/toolkit/query").coreModuleName>;
|
|
10
|
-
export declare const fetchAnswer: (fetchAnswerParams:
|
|
11
|
-
export declare const selectAnswer: (
|
|
10
|
+
export declare const fetchAnswer: (fetchAnswerParams: AnswerApiQueryParams) => import("redux-thunk").ThunkAction<import("@reduxjs/toolkit/query").QueryActionCreatorResult<import("@reduxjs/toolkit/query").QueryDefinition<AnswerApiQueryParams, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {} & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GeneratedAnswerStream, "answer">>, any, any, UnknownAction>;
|
|
11
|
+
export declare const selectAnswer: (selectAnswerParams: AnswerApiQueryParams) => (state: import("@reduxjs/toolkit/query").RootState<{
|
|
12
|
+
getAnswer: import("@reduxjs/toolkit/query").QueryDefinition<AnswerApiQueryParams, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {} & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GeneratedAnswerStream, "answer">;
|
|
13
|
+
}, never, "answer">) => ({
|
|
12
14
|
status: import("@reduxjs/toolkit/query").QueryStatus.uninitialized;
|
|
13
15
|
originalArgs?: undefined | undefined;
|
|
14
16
|
data?: undefined | undefined;
|
|
@@ -27,7 +29,7 @@ export declare const selectAnswer: (state: StreamAnswerAPIState) => ({
|
|
|
27
29
|
status: import("@reduxjs/toolkit/query").QueryStatus.fulfilled;
|
|
28
30
|
error: undefined;
|
|
29
31
|
endpointName: string;
|
|
30
|
-
originalArgs:
|
|
32
|
+
originalArgs: AnswerApiQueryParams;
|
|
31
33
|
requestId: string;
|
|
32
34
|
startedTimeStamp: number;
|
|
33
35
|
data: GeneratedAnswerStream;
|
|
@@ -40,7 +42,7 @@ export declare const selectAnswer: (state: StreamAnswerAPIState) => ({
|
|
|
40
42
|
isError: false;
|
|
41
43
|
}) | ({
|
|
42
44
|
status: import("@reduxjs/toolkit/query").QueryStatus.pending;
|
|
43
|
-
originalArgs:
|
|
45
|
+
originalArgs: AnswerApiQueryParams;
|
|
44
46
|
requestId: string;
|
|
45
47
|
data?: GeneratedAnswerStream | undefined;
|
|
46
48
|
error?: import("@reduxjs/toolkit").SerializedError | import("@reduxjs/toolkit/query").FetchBaseQueryError | undefined;
|
|
@@ -58,7 +60,7 @@ export declare const selectAnswer: (state: StreamAnswerAPIState) => ({
|
|
|
58
60
|
data?: GeneratedAnswerStream | undefined;
|
|
59
61
|
endpointName: string;
|
|
60
62
|
fulfilledTimeStamp?: number | undefined;
|
|
61
|
-
originalArgs:
|
|
63
|
+
originalArgs: AnswerApiQueryParams;
|
|
62
64
|
requestId: string;
|
|
63
65
|
startedTimeStamp: number;
|
|
64
66
|
error: import("@reduxjs/toolkit").SerializedError | import("@reduxjs/toolkit/query").FetchBaseQueryError;
|
|
@@ -110,7 +110,7 @@ type GenQAParameters = {
|
|
|
110
110
|
responseFormat: ResponseFormatParameters;
|
|
111
111
|
citationsFieldToInclude: string[];
|
|
112
112
|
};
|
|
113
|
-
type ResponseFormatParameters = {
|
|
113
|
+
export type ResponseFormatParameters = {
|
|
114
114
|
contentFormat?: GeneratedContentFormat[];
|
|
115
115
|
};
|
|
116
116
|
export declare const baseSearchRequest: (req: BaseParam & AuthenticationParam, method: HttpMethods, contentType: HTTPContentType, path: string) => Pick<PlatformClientCallOptions, "accessToken" | "method" | "contentType" | "url" | "origin">;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { GeneratedAnswerCitationsPayload, GeneratedAnswerMessagePayload } from '../../api/generated-answer/generated-answer-event-payload.js';
|
|
2
2
|
import type { StreamAnswerAPIState } from '../../api/knowledge/stream-answer-api-state.js';
|
|
3
|
-
import type { SearchRequest } from '../../api/search/search/search-request.js';
|
|
4
3
|
import type { SearchThunkExtraArguments } from '../../app/search-thunk-extra-arguments.js';
|
|
4
|
+
import type { AnswerApiQueryParams } from '../../features/generated-answer/generated-answer-request.js';
|
|
5
5
|
import type { ConfigurationSection, DebugSection, GeneratedAnswerSection, SearchSection } from '../../state/state-sections.js';
|
|
6
6
|
import { type GeneratedResponseFormat } from './generated-response-format.js';
|
|
7
7
|
type StateNeededByGeneratedAnswerStream = ConfigurationSection & SearchSection & GeneratedAnswerSection & DebugSection;
|
|
@@ -35,7 +35,7 @@ export declare const updateAnswerConfigurationId: import("@reduxjs/toolkit").Act
|
|
|
35
35
|
export declare const registerFieldsToIncludeInCitations: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: string[]], string[], "generatedAnswer/registerFieldsToIncludeInCitations", never, never>;
|
|
36
36
|
export declare const setIsAnswerGenerated: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: boolean], boolean, "generatedAnswer/setIsAnswerGenerated", never, never>;
|
|
37
37
|
export declare const setCannotAnswer: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: boolean], boolean, "generatedAnswer/setCannotAnswer", never, never>;
|
|
38
|
-
export declare const setAnswerApiQueryParams: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload:
|
|
38
|
+
export declare const setAnswerApiQueryParams: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: AnswerApiQueryParams], unknown, "generatedAnswer/setAnswerApiQueryParams", never, never>;
|
|
39
39
|
interface StreamAnswerArgs {
|
|
40
40
|
setAbortControllerRef: (ref: AbortController) => void;
|
|
41
41
|
}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/** biome-ignore-all lint/suspicious/noExplicitAny: <mock> */
|
|
2
|
+
import type { StreamAnswerAPIState } from '../../api/knowledge/stream-answer-api-state.js';
|
|
3
|
+
export declare const streamAnswerAPIStateMock: StreamAnswerAPIState;
|
|
4
|
+
export declare const streamAnswerAPIStateMockWithATabWithAnExpression: StreamAnswerAPIState;
|
|
5
|
+
export declare const streamAnswerAPIStateMockWithoutAnyTab: StreamAnswerAPIState;
|
|
6
|
+
export declare const streamAnswerAPIStateMockWithStaticFiltersSelected: StreamAnswerAPIState;
|
|
7
|
+
export declare const streamAnswerAPIStateMockWithNonValidFilters: StreamAnswerAPIState;
|
|
8
|
+
export declare const streamAnswerAPIStateMockWithoutAnyFilters: StreamAnswerAPIState;
|
|
9
|
+
export declare const streamAnswerAPIStateMockWithStaticFiltersAndTabExpression: StreamAnswerAPIState;
|
|
10
|
+
export declare const streamAnswerAPIStateMockWithStaticFiltersAndTabExpressionWithEmptyCQ: {
|
|
11
|
+
advancedSearchQueries: {
|
|
12
|
+
cq: string;
|
|
13
|
+
cqWasSet: boolean;
|
|
14
|
+
aq: string;
|
|
15
|
+
aqWasSet: boolean;
|
|
16
|
+
lq: string;
|
|
17
|
+
lqWasSet: boolean;
|
|
18
|
+
dq: string;
|
|
19
|
+
dqWasSet: boolean;
|
|
20
|
+
defaultFilters: {
|
|
21
|
+
cq: string;
|
|
22
|
+
aq: string;
|
|
23
|
+
lq: string;
|
|
24
|
+
dq: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
searchHub: string;
|
|
28
|
+
pipeline: string;
|
|
29
|
+
answer: import("@reduxjs/toolkit/query").CombinedState<{
|
|
30
|
+
getAnswer: import("@reduxjs/toolkit/query").QueryDefinition<Partial<import("../../api/search/search/search-request.js").SearchRequest>, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {} & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, import("../../api/knowledge/generated-answer-stream.js").GeneratedAnswerStream, "answer">;
|
|
31
|
+
}, never, "answer">;
|
|
32
|
+
configuration: import("../configuration/configuration-state.js").ConfigurationState;
|
|
33
|
+
facetSet?: import("../facets/facet-set/facet-set-state.js").FacetSetState | undefined;
|
|
34
|
+
dateFacetSet?: import("../facets/range-facets/date-facet-set/date-facet-set-state.js").DateFacetSetState | undefined;
|
|
35
|
+
numericFacetSet?: import("../facets/range-facets/numeric-facet-set/numeric-facet-set-state.js").NumericFacetSetState | undefined;
|
|
36
|
+
categoryFacetSet?: import("../facets/category-facet-set/category-facet-set-state.js").CategoryFacetSetState | undefined;
|
|
37
|
+
automaticFacetSet?: import("../facets/automatic-facet-set/automatic-facet-set-state.js").AutomaticFacetSetState | undefined;
|
|
38
|
+
facetOptions?: import("../facet-options/facet-options-state.js").FacetOptionsState | undefined;
|
|
39
|
+
query?: import("../query/query-state.js").QueryState | undefined;
|
|
40
|
+
tabSet?: import("../tab-set/tab-set-state.js").TabSetState | undefined;
|
|
41
|
+
staticFilterSet?: import("../static-filter-set/static-filter-set-state.js").StaticFilterSetState | undefined;
|
|
42
|
+
pagination?: import("../pagination/pagination-state.js").PaginationState | undefined;
|
|
43
|
+
sortCriteria?: string | undefined;
|
|
44
|
+
context?: import("../context/context-state.js").ContextState | undefined;
|
|
45
|
+
dictionaryFieldContext?: import("../dictionary-field-context/dictionary-field-context-state.js").DictionaryFieldContextState | undefined;
|
|
46
|
+
querySet?: import("../query-set/query-set-state.js").QuerySetState | undefined;
|
|
47
|
+
debug?: boolean | undefined;
|
|
48
|
+
facetSearchSet?: import("../facets/facet-search-set/specific/specific-facet-search-set-state.js").SpecificFacetSearchSetState | undefined;
|
|
49
|
+
categoryFacetSearchSet?: import("../facets/facet-search-set/category/category-facet-search-set-state.js").CategoryFacetSearchSetState | undefined;
|
|
50
|
+
standaloneSearchBoxSet?: import("../standalone-search-box-set/standalone-search-box-set-state.js").StandaloneSearchBoxSetState | undefined;
|
|
51
|
+
querySuggest?: import("../query-suggest/query-suggest-state.js").QuerySuggestSet | undefined;
|
|
52
|
+
search?: import("../search/search-state.js").SearchState | undefined;
|
|
53
|
+
resultPreview?: import("../result-preview/result-preview-state.js").ResultPreviewState | undefined;
|
|
54
|
+
didYouMean?: import("../did-you-mean/did-you-mean-state.js").DidYouMeanState | undefined;
|
|
55
|
+
fields?: import("../fields/fields-state.js").FieldsState | undefined;
|
|
56
|
+
facetOrder?: import("../facets/facet-order/facet-order-state.js").FacetOrderState | undefined;
|
|
57
|
+
version?: string | undefined;
|
|
58
|
+
history?: import("../../app/undoable.js").StateWithHistory<import("../history/history-state.js").HistoryState> | undefined;
|
|
59
|
+
folding?: import("../folding/folding-state.js").FoldingState | undefined;
|
|
60
|
+
triggers?: import("../triggers/triggers-state.js").TriggerState | undefined;
|
|
61
|
+
questionAnswering?: import("../question-answering/question-answering-state.js").QuestionAnsweringState | undefined;
|
|
62
|
+
recentResults?: import("../recent-results/recent-results-state.js").RecentResultsState | undefined;
|
|
63
|
+
recentQueries?: import("../recent-queries/recent-queries-state.js").RecentQueriesState | undefined;
|
|
64
|
+
excerptLength?: import("../excerpt-length/excerpt-length-state.js").ExcerptLengthState | undefined;
|
|
65
|
+
generatedAnswer: import("./generated-answer-state.js").GeneratedAnswerState;
|
|
66
|
+
instantResults?: import("../instant-results/instant-results-state.js").InstantResultsState | undefined;
|
|
67
|
+
insightConfiguration?: import("../insight-configuration/insight-configuration-state.js").InsightConfigurationState | undefined;
|
|
68
|
+
};
|
|
69
|
+
export declare const streamAnswerAPIStateMockWithoutSearchAction: StreamAnswerAPIState;
|
|
70
|
+
export declare const streamAnswerAPIStateMockWithAnalyticsEnabled: StreamAnswerAPIState;
|
|
71
|
+
export declare const streamAnswerAPIStateMockWithFoldingDisabled: StreamAnswerAPIState;
|
|
72
|
+
export declare const streamAnswerAPIStateMockWithFoldingEnabled: StreamAnswerAPIState;
|
|
73
|
+
export declare const streamAnswerAPIStateMockWithDictionaryFieldContext: StreamAnswerAPIState;
|
|
74
|
+
export declare const streamAnswerAPIStateMockWithExcerptLength: StreamAnswerAPIState;
|
|
75
|
+
export declare const streamAnswerAPIStateMockWithQuerySyntaxEnabled: StreamAnswerAPIState;
|
|
76
|
+
export declare const expectedStreamAnswerAPIParam: {
|
|
77
|
+
q: string;
|
|
78
|
+
aq: string;
|
|
79
|
+
cq: string;
|
|
80
|
+
dq: string;
|
|
81
|
+
lq: string;
|
|
82
|
+
enableQuerySyntax: boolean;
|
|
83
|
+
context: {
|
|
84
|
+
testKey: string;
|
|
85
|
+
};
|
|
86
|
+
pipelineRuleParameters: {
|
|
87
|
+
mlGenerativeQuestionAnswering: {
|
|
88
|
+
responseFormat: {
|
|
89
|
+
contentFormat: string[];
|
|
90
|
+
};
|
|
91
|
+
citationsFieldToInclude: never[];
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
searchHub: string;
|
|
95
|
+
facets: ({
|
|
96
|
+
filterFacetCount: boolean;
|
|
97
|
+
injectionDepth: number;
|
|
98
|
+
numberOfValues: number;
|
|
99
|
+
sortCriteria: string;
|
|
100
|
+
resultsMustMatch: string;
|
|
101
|
+
type: string;
|
|
102
|
+
currentValues: never[];
|
|
103
|
+
freezeCurrentValues: boolean;
|
|
104
|
+
isFieldExpanded: boolean;
|
|
105
|
+
preventAutoSelect: boolean;
|
|
106
|
+
facetId: string;
|
|
107
|
+
field: string;
|
|
108
|
+
rangeAlgorithm?: undefined;
|
|
109
|
+
generateAutomaticRanges?: undefined;
|
|
110
|
+
delimitingCharacter?: undefined;
|
|
111
|
+
basePath?: undefined;
|
|
112
|
+
filterByBasePath?: undefined;
|
|
113
|
+
} | {
|
|
114
|
+
filterFacetCount: boolean;
|
|
115
|
+
injectionDepth: number;
|
|
116
|
+
numberOfValues: number;
|
|
117
|
+
sortCriteria: string;
|
|
118
|
+
rangeAlgorithm: string;
|
|
119
|
+
resultsMustMatch: string;
|
|
120
|
+
currentValues: {
|
|
121
|
+
start: string;
|
|
122
|
+
end: string;
|
|
123
|
+
endInclusive: boolean;
|
|
124
|
+
state: string;
|
|
125
|
+
}[];
|
|
126
|
+
preventAutoSelect: boolean;
|
|
127
|
+
type: string;
|
|
128
|
+
facetId: string;
|
|
129
|
+
field: string;
|
|
130
|
+
generateAutomaticRanges: boolean;
|
|
131
|
+
freezeCurrentValues?: undefined;
|
|
132
|
+
isFieldExpanded?: undefined;
|
|
133
|
+
delimitingCharacter?: undefined;
|
|
134
|
+
basePath?: undefined;
|
|
135
|
+
filterByBasePath?: undefined;
|
|
136
|
+
} | {
|
|
137
|
+
delimitingCharacter: string;
|
|
138
|
+
filterFacetCount: boolean;
|
|
139
|
+
injectionDepth: number;
|
|
140
|
+
numberOfValues: number;
|
|
141
|
+
sortCriteria: string;
|
|
142
|
+
basePath: never[];
|
|
143
|
+
filterByBasePath: boolean;
|
|
144
|
+
resultsMustMatch: string;
|
|
145
|
+
currentValues: never[];
|
|
146
|
+
preventAutoSelect: boolean;
|
|
147
|
+
type: string;
|
|
148
|
+
facetId: string;
|
|
149
|
+
field: string;
|
|
150
|
+
freezeCurrentValues?: undefined;
|
|
151
|
+
isFieldExpanded?: undefined;
|
|
152
|
+
rangeAlgorithm?: undefined;
|
|
153
|
+
generateAutomaticRanges?: undefined;
|
|
154
|
+
} | {
|
|
155
|
+
filterFacetCount: boolean;
|
|
156
|
+
injectionDepth: number;
|
|
157
|
+
numberOfValues: number;
|
|
158
|
+
sortCriteria: string;
|
|
159
|
+
rangeAlgorithm: string;
|
|
160
|
+
resultsMustMatch: string;
|
|
161
|
+
currentValues: {
|
|
162
|
+
endInclusive: boolean;
|
|
163
|
+
state: string;
|
|
164
|
+
start: number;
|
|
165
|
+
end: number;
|
|
166
|
+
}[];
|
|
167
|
+
preventAutoSelect: boolean;
|
|
168
|
+
type: string;
|
|
169
|
+
facetId: string;
|
|
170
|
+
field: string;
|
|
171
|
+
generateAutomaticRanges: boolean;
|
|
172
|
+
freezeCurrentValues?: undefined;
|
|
173
|
+
isFieldExpanded?: undefined;
|
|
174
|
+
delimitingCharacter?: undefined;
|
|
175
|
+
basePath?: undefined;
|
|
176
|
+
filterByBasePath?: undefined;
|
|
177
|
+
})[];
|
|
178
|
+
fieldsToInclude: string[];
|
|
179
|
+
queryCorrection: {
|
|
180
|
+
enabled: boolean;
|
|
181
|
+
options: {
|
|
182
|
+
automaticallyCorrect: string;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
enableDidYouMean: boolean;
|
|
186
|
+
numberOfResults: number;
|
|
187
|
+
firstResult: number;
|
|
188
|
+
tab: string;
|
|
189
|
+
locale: string;
|
|
190
|
+
timezone: string;
|
|
191
|
+
referrer: string;
|
|
192
|
+
debug: boolean;
|
|
193
|
+
actionsHistory: never[];
|
|
194
|
+
sortCriteria: string;
|
|
195
|
+
facetOptions: {
|
|
196
|
+
freezeFacetOrder: boolean;
|
|
197
|
+
};
|
|
198
|
+
analytics: {
|
|
199
|
+
actionCause: string;
|
|
200
|
+
capture: boolean;
|
|
201
|
+
clientId: string;
|
|
202
|
+
clientTimestamp: string;
|
|
203
|
+
customData: undefined;
|
|
204
|
+
documentLocation: string;
|
|
205
|
+
documentReferrer: string;
|
|
206
|
+
originContext: string;
|
|
207
|
+
source: string[];
|
|
208
|
+
};
|
|
209
|
+
};
|
|
@@ -1,85 +1,56 @@
|
|
|
1
|
+
import type { HistoryElement } from '../../api/analytics/coveo.analytics/history-store.js';
|
|
1
2
|
import type { GeneratedAnswerStreamRequest } from '../../api/generated-answer/generated-answer-request.js';
|
|
2
3
|
import type { StreamAnswerAPIState } from '../../api/knowledge/stream-answer-api-state.js';
|
|
4
|
+
import type { AnalyticsParam, ResponseFormatParameters } from '../../api/search/search-api-params.js';
|
|
3
5
|
import type { NavigatorContext } from '../../app/navigator-context-provider.js';
|
|
4
6
|
import type { ConfigurationSection, GeneratedAnswerSection, SearchSection } from '../../state/state-sections.js';
|
|
7
|
+
import type { ContextPayload } from '../context/context-state.js';
|
|
8
|
+
import type { FacetOptions } from '../facet-options/facet-options.js';
|
|
9
|
+
import type { AnyFacetRequest } from '../facets/generic/interfaces/generic-facet-request.js';
|
|
5
10
|
type StateNeededByGeneratedAnswerStream = ConfigurationSection & SearchSection & GeneratedAnswerSection;
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
trackingId?: string;
|
|
20
|
-
capture?: boolean;
|
|
21
|
-
source?: string[];
|
|
11
|
+
export interface AnswerApiQueryParams {
|
|
12
|
+
q?: string;
|
|
13
|
+
aq?: string;
|
|
14
|
+
cq?: string;
|
|
15
|
+
dq?: string;
|
|
16
|
+
lq?: string;
|
|
17
|
+
enableQuerySyntax?: boolean;
|
|
18
|
+
context?: ContextPayload;
|
|
19
|
+
pipelineRuleParameters?: {
|
|
20
|
+
mlGenerativeQuestionAnswering: {
|
|
21
|
+
responseFormat: ResponseFormatParameters;
|
|
22
|
+
citationsFieldToInclude: string[];
|
|
23
|
+
};
|
|
22
24
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
dictionaryFieldContext?: import("../dictionary-field-context/dictionary-field-context-state.js").DictionaryFieldContextPayload | undefined;
|
|
28
|
-
excerptLength?: number | undefined;
|
|
29
|
-
filterField?: string | undefined;
|
|
30
|
-
childField?: string | undefined;
|
|
31
|
-
parentField?: string | undefined;
|
|
32
|
-
filterFieldRange?: number | undefined;
|
|
33
|
-
actionsHistory: import("../../api/analytics/coveo.analytics/history-store.js").HistoryElement[];
|
|
34
|
-
referrer: string;
|
|
35
|
-
debug?: boolean | undefined;
|
|
36
|
-
tab: string;
|
|
37
|
-
locale: string;
|
|
38
|
-
timezone: string;
|
|
39
|
-
numberOfResults?: number | undefined;
|
|
40
|
-
firstResult?: number | undefined;
|
|
25
|
+
searchHub?: string;
|
|
26
|
+
pipeline?: string;
|
|
27
|
+
facets?: AnyFacetRequest[];
|
|
28
|
+
fieldsToInclude?: string[];
|
|
41
29
|
queryCorrection?: {
|
|
42
30
|
enabled: boolean;
|
|
43
31
|
options: {
|
|
44
|
-
automaticallyCorrect:
|
|
45
|
-
};
|
|
46
|
-
} | undefined;
|
|
47
|
-
enableDidYouMean?: boolean | undefined;
|
|
48
|
-
fieldsToInclude?: string[] | undefined;
|
|
49
|
-
facets?: (import("../facets/facet-set/interfaces/request.js").FacetRequest | import("../facets/category-facet-set/interfaces/request.js").CategoryFacetRequest | import("../facets/range-facets/numeric-facet-set/interfaces/request.js").NumericFacetRequest | {
|
|
50
|
-
currentValues: {
|
|
51
|
-
start: string;
|
|
52
|
-
end: string;
|
|
53
|
-
endInclusive: boolean;
|
|
54
|
-
state: import("../../ssr.index.js").FacetValueState;
|
|
55
|
-
previousState?: import("../../ssr.index.js").FacetValueState;
|
|
56
|
-
}[];
|
|
57
|
-
sortCriteria: import("../../ssr.index.js").RangeFacetSortCriterion;
|
|
58
|
-
rangeAlgorithm: import("../../ssr.index.js").RangeFacetRangeAlgorithm;
|
|
59
|
-
facetId: string;
|
|
60
|
-
field: string;
|
|
61
|
-
filterFacetCount: boolean;
|
|
62
|
-
injectionDepth: number;
|
|
63
|
-
numberOfValues: number;
|
|
64
|
-
preventAutoSelect: boolean;
|
|
65
|
-
resultsMustMatch: import("../../ssr.index.js").FacetResultsMustMatch;
|
|
66
|
-
generateAutomaticRanges: boolean;
|
|
67
|
-
type: "dateRange";
|
|
68
|
-
})[] | undefined;
|
|
69
|
-
pipeline?: string | undefined;
|
|
70
|
-
searchHub?: string | undefined;
|
|
71
|
-
pipelineRuleParameters: {
|
|
72
|
-
mlGenerativeQuestionAnswering: {
|
|
73
|
-
responseFormat: import("./generated-response-format.js").GeneratedResponseFormat;
|
|
74
|
-
citationsFieldToInclude: string[];
|
|
32
|
+
automaticallyCorrect: 'whenNoResults' | 'never';
|
|
75
33
|
};
|
|
76
34
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
35
|
+
enableDidYouMean?: boolean;
|
|
36
|
+
numberOfResults?: number;
|
|
37
|
+
firstResult?: number;
|
|
38
|
+
tab?: string;
|
|
39
|
+
locale?: string;
|
|
40
|
+
timezone?: string;
|
|
41
|
+
debug?: boolean;
|
|
42
|
+
referrer?: string;
|
|
43
|
+
actionsHistory?: HistoryElement[];
|
|
44
|
+
filterField?: string;
|
|
45
|
+
childField?: string;
|
|
46
|
+
parentField?: string;
|
|
47
|
+
filterFieldRange?: number;
|
|
48
|
+
excerptLength?: number;
|
|
49
|
+
dictionaryFieldContext?: Record<string, string>;
|
|
50
|
+
sortCriteria?: string;
|
|
51
|
+
facetOptions?: FacetOptions;
|
|
52
|
+
analytics?: AnalyticsParam['analytics'];
|
|
53
|
+
}
|
|
54
|
+
export declare const buildStreamingRequest: (state: StateNeededByGeneratedAnswerStream) => Promise<GeneratedAnswerStreamRequest>;
|
|
55
|
+
export declare const constructAnswerAPIQueryParams: (state: StreamAnswerAPIState, navigatorContext: NavigatorContext) => AnswerApiQueryParams;
|
|
85
56
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GeneratedAnswerCitation } from '../../api/generated-answer/generated-answer-event-payload.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AnswerApiQueryParams } from '../../features/generated-answer/generated-answer-request.js';
|
|
3
3
|
import type { GeneratedContentFormat, GeneratedResponseFormat } from './generated-response-format.js';
|
|
4
4
|
/**
|
|
5
5
|
* A scoped and simplified part of the headless state that is relevant to the `GeneratedAnswer` component.
|
|
@@ -90,6 +90,6 @@ export interface GeneratedAnswerState {
|
|
|
90
90
|
/**
|
|
91
91
|
* The query parameters used for the answer API request cache key
|
|
92
92
|
*/
|
|
93
|
-
answerApiQueryParams?:
|
|
93
|
+
answerApiQueryParams?: AnswerApiQueryParams;
|
|
94
94
|
}
|
|
95
95
|
export declare function getGeneratedAnswerInitialState(): GeneratedAnswerState;
|
|
@@ -4,7 +4,7 @@ import type { InsightQueryRequest } from '../../api/service/insight/query/query-
|
|
|
4
4
|
import type { CategoryFacetSection, ConfigurationSection, ContextSection, DateFacetSection, DidYouMeanSection, FacetSection, FieldsSection, FoldingSection, InsightCaseContextSection, InsightConfigurationSection, NumericFacetSection, PaginationSection, QuerySection, QuerySetSection, QuerySuggestionSection, SearchSection, SortSection, TabSection } from '../../state/state-sections.js';
|
|
5
5
|
import type { InsightAction as LegacyInsightAction } from '../analytics/analytics-utils.js';
|
|
6
6
|
import type { FetchQuerySuggestionsActionCreatorPayload, FetchQuerySuggestionsThunkReturn } from '../query-suggest/query-suggest-actions.js';
|
|
7
|
-
import {
|
|
7
|
+
import type { ExecuteSearchThunkReturn, SearchAction } from '../search/search-actions.js';
|
|
8
8
|
import { type MappedSearchRequest } from '../search/search-mappings.js';
|
|
9
9
|
export type StateNeededByExecuteSearch = ConfigurationSection & InsightConfigurationSection & Partial<InsightCaseContextSection & SearchSection & QuerySection & FacetSection & NumericFacetSection & DateFacetSection & CategoryFacetSection & PaginationSection & TabSection & FieldsSection & DidYouMeanSection & SortSection & FoldingSection & ContextSection>;
|
|
10
10
|
export declare const fetchFromAPI: (client: InsightAPIClient, state: StateNeededByExecuteSearch, { request, mappings }: MappedSearchRequest<InsightQueryRequest>, options?: SearchOptions) => Promise<{
|
|
@@ -6,9 +6,7 @@ type StateNeededBySearchRequest = ConfigurationSection & Partial<SearchAppState>
|
|
|
6
6
|
export declare const buildSearchRequest: (state: StateNeededBySearchRequest, eventDescription?: EventDescription) => Promise<import("../search-mappings.js").MappedSearchRequest<{
|
|
7
7
|
pipelineRuleParameters?: {
|
|
8
8
|
mlGenerativeQuestionAnswering?: {
|
|
9
|
-
responseFormat:
|
|
10
|
-
contentFormat?: import("../../generated-answer/generated-response-format.js").GeneratedContentFormat[];
|
|
11
|
-
};
|
|
9
|
+
responseFormat: import("../../../api/search/search-api-params.js").ResponseFormatParameters;
|
|
12
10
|
citationsFieldToInclude: string[];
|
|
13
11
|
};
|
|
14
12
|
};
|
|
@@ -7,9 +7,7 @@ type StateNeededBySearchRequest = ConfigurationSection & Partial<SearchAppState>
|
|
|
7
7
|
export declare const buildSearchRequest: (state: StateNeededBySearchRequest, navigatorContext: NavigatorContext, eventDescription?: EventDescription) => Promise<import("./search-mappings.js").MappedSearchRequest<{
|
|
8
8
|
pipelineRuleParameters?: {
|
|
9
9
|
mlGenerativeQuestionAnswering?: {
|
|
10
|
-
responseFormat:
|
|
11
|
-
contentFormat?: import("../generated-answer/generated-response-format.js").GeneratedContentFormat[];
|
|
12
|
-
};
|
|
10
|
+
responseFormat: import("../../api/search/search-api-params.js").ResponseFormatParameters;
|
|
13
11
|
citationsFieldToInclude: string[];
|
|
14
12
|
};
|
|
15
13
|
};
|
|
@@ -60,9 +60,7 @@ export declare function buildMockSearchRequest(config?: Partial<SearchRequest>):
|
|
|
60
60
|
};
|
|
61
61
|
pipelineRuleParameters?: {
|
|
62
62
|
mlGenerativeQuestionAnswering?: {
|
|
63
|
-
responseFormat:
|
|
64
|
-
contentFormat?: import("../index.js").GeneratedContentFormat[];
|
|
65
|
-
};
|
|
63
|
+
responseFormat: import("../api/search/search-api-params.js").ResponseFormatParameters;
|
|
66
64
|
citationsFieldToInclude: string[];
|
|
67
65
|
};
|
|
68
66
|
};
|