Skip to content

Commit 6ae894d

Browse files
Dan JonesDan Jones
authored andcommitted
Remove MappedSearchModeResponse
1 parent 8a0204f commit 6ae894d

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

src/query/response/response-mapping.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ import {
1111
StreamedTokens,
1212
ProgressMessage,
1313
DateFilterValue,
14-
MappedSearchModeResponse,
14+
//MappedSearchModeResponse,
1515
WeaviateObjectWithCollection,
1616
WeaviateReturnWithCollection,
17+
SearchModeResponse,
1718
} from "./response.js";
1819

1920
import {
@@ -360,11 +361,11 @@ export const mapWeviateSearchResults = (
360361
export const mapSearchOnlyResponse = (
361362
response: ApiSearchModeResponse,
362363
): {
363-
mappedResponse: MappedSearchModeResponse;
364+
mappedResponse: Omit<SearchModeResponse, "next">;
364365
apiSearches: ApiSearchResult[] | undefined;
365366
} => {
366367
const apiSearches = response.searches;
367-
const mappedResponse: MappedSearchModeResponse = {
368+
const mappedResponse: Omit<SearchModeResponse, "next"> = {
368369
originalQuery: response.original_query,
369370
searches: apiSearches ? mapInnerSearches(apiSearches) : undefined,
370371
usage: mapUsage(response.usage),

src/query/response/response.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -271,14 +271,6 @@ export type WeaviateReturnWithCollection = WeaviateReturn<undefined> & {
271271
objects: WeaviateObjectWithCollection[];
272272
};
273273

274-
export type MappedSearchModeResponse = {
275-
originalQuery: string;
276-
searches?: SearchResult[];
277-
usage: Usage;
278-
totalTime: number;
279-
searchResults: WeaviateReturnWithCollection;
280-
};
281-
282274
/** Options for the executing a prepared QueryAgent search. */
283275
export type SearchExecutionOptions = {
284276
/** The maximum number of results to return. */
@@ -287,6 +279,11 @@ export type SearchExecutionOptions = {
287279
offset?: number;
288280
};
289281

290-
export type SearchModeResponse = MappedSearchModeResponse & {
282+
export type SearchModeResponse = {
283+
originalQuery: string;
284+
searches?: SearchResult[];
285+
usage: Usage;
286+
totalTime: number;
287+
searchResults: WeaviateReturnWithCollection;
291288
next: (options: SearchExecutionOptions) => Promise<SearchModeResponse>;
292289
};

0 commit comments

Comments
 (0)