Skip to content

Commit c9365f2

Browse files
danmichaeljonesDan Jones
andauthored
Update Query Agent response model (#16)
* Update responses types for new fetch queries * Update response model with removed fields --------- Co-authored-by: Dan Jones <[email protected]>
1 parent 870b1a7 commit c9365f2

File tree

4 files changed

+2
-17
lines changed

4 files changed

+2
-17
lines changed

src/query/response/api-response-mapping.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ export const mapApiResponse = (
2727
aggregations: mapApiAggregations(response.aggregations),
2828
usage: mapApiUsage(response.usage),
2929
total_time: response.totalTime,
30-
aggregation_answer: response.aggregationAnswer,
31-
has_aggregation_answer: response.hasAggregationAnswer,
32-
has_search_answer: response.hasSearchAnswer,
3330
is_partial_answer: response.isPartialAnswer,
3431
missing_information: response.missingInformation,
3532
final_answer: response.finalAnswer,

src/query/response/api-response.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ export type ApiQueryAgentResponse = {
1212
aggregations: ApiAggregationResult[][];
1313
usage: ApiUsage;
1414
total_time: number;
15-
aggregation_answer?: string;
16-
has_aggregation_answer: boolean;
17-
has_search_answer: boolean;
1815
is_partial_answer: boolean;
1916
missing_information: string[];
2017
final_answer: string;
@@ -23,7 +20,7 @@ export type ApiQueryAgentResponse = {
2320

2421
export type ApiSearchResult = {
2522
collection: string;
26-
queries: string[];
23+
queries: (string | null)[];
2724
filters: ApiPropertyFilter[][];
2825
filter_operators: "AND" | "OR";
2926
};

src/query/response/response-mapping.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ export const mapResponse = (
3333
aggregations: mapAggregations(response.aggregations),
3434
usage: mapUsage(response.usage),
3535
totalTime: response.total_time,
36-
aggregationAnswer: response.aggregation_answer,
37-
hasAggregationAnswer: response.has_aggregation_answer,
38-
hasSearchAnswer: response.has_search_answer,
3936
isPartialAnswer: response.is_partial_answer,
4037
missingInformation: response.missing_information,
4138
finalAnswer: response.final_answer,
@@ -155,9 +152,6 @@ export const mapResponseFromSSE = (sse: ServerSentEvent): QueryAgentResponse =>
155152
aggregations: mapAggregations(data.aggregations),
156153
usage: mapUsage(data.usage),
157154
totalTime: data.total_time,
158-
aggregationAnswer: data.aggregation_answer,
159-
hasAggregationAnswer: data.has_aggregation_answer,
160-
hasSearchAnswer: data.has_search_answer,
161155
isPartialAnswer: data.is_partial_answer,
162156
missingInformation: data.missing_information,
163157
finalAnswer: data.final_answer,

src/query/response/response.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ export type QueryAgentResponse = {
66
aggregations: AggregationResult[][];
77
usage: Usage;
88
totalTime: number;
9-
aggregationAnswer?: string;
10-
hasAggregationAnswer: boolean;
11-
hasSearchAnswer: boolean;
129
isPartialAnswer: boolean;
1310
missingInformation: string[];
1411
finalAnswer: string;
@@ -18,7 +15,7 @@ export type QueryAgentResponse = {
1815

1916
export type SearchResult = {
2017
collection: string;
21-
queries: string[];
18+
queries: (string | null)[];
2219
filters: PropertyFilter[][];
2320
filterOperators: "AND" | "OR";
2421
};

0 commit comments

Comments
 (0)