-
Notifications
You must be signed in to change notification settings - Fork 1
Add search-only mode #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
d9c371d
21fb90d
9d5c9d7
04d8150
a7f980c
11cef97
019d72f
368bda9
62dd66d
498a659
9749bf2
f78c508
8a0204f
6ae894d
b3f53a8
85c5702
89eaebf
e181535
b6c195f
f43b595
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| export * from "./agent.js"; | ||
| export { QueryAgentCollectionConfig } from "./collection.js"; | ||
| export * from "./response/index.js"; | ||
| export * from "./search.js"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| import { WeaviateReturn } from "weaviate-client"; | ||
|
|
||
| import { | ||
| NumericMetrics, | ||
| TextMetrics, | ||
|
|
@@ -177,3 +179,11 @@ export type ApiSource = { | |
| object_id: string; | ||
| collection: string; | ||
| }; | ||
|
|
||
| export type ApiSearchModeResponse<T> = { | ||
| original_query: string; | ||
| searches?: ApiSearchResult[]; | ||
| usage: ApiUsage; | ||
| total_time: number; | ||
| search_results: WeaviateReturn<T>; | ||
|
||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| import { WeaviateReturn } from "weaviate-client"; | ||
|
|
||
| export type QueryAgentResponse = { | ||
| outputType: "finalState"; | ||
| originalQuery: string; | ||
|
|
@@ -260,3 +262,18 @@ export type StreamedTokens = { | |
| outputType: "streamedTokens"; | ||
| delta: string; | ||
| }; | ||
|
|
||
| export type MappedSearchModeResponse<T> = { | ||
|
||
| originalQuery: string; | ||
| searches?: SearchResult[]; | ||
| usage: Usage; | ||
| totalTime: number; | ||
| searchResults: WeaviateReturn<T>; | ||
| }; | ||
|
|
||
| export type SearchModeResponse<T> = MappedSearchModeResponse<T> & { | ||
| next: (options?: { | ||
| limit?: number; | ||
| offset?: number; | ||
| }) => Promise<SearchModeResponse<T>>; | ||
|
||
| }; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, having this be
options?: QueryAgentSearchOnlyOptionswould be clearer for a user on the exact nature of this functional argument. Having the object keys explicit and it having a default of{}is quite different to the rest of the TS client so might be a point of confusion for usersThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense, but doesn't match the existing
QueryAgentmethods (which I don't watch to touch now). I'll CC @augustas1 to see what he thinks once he's back, but for now I'd prefer to be consistent with the existingrun/streammethods.I've modified the signature a little though, to try and make the default argument values clearer 👍