-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add client and types for API v2 #19
Conversation
b706359
to
3607435
Compare
} from "@vectara/stream-query-client"; | ||
|
||
// TODO: Switch back to prod values before merging |
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.
I need to switch this back before merging.
@@ -0,0 +1,2 @@ | |||
// TODO: Switch back to prod values before merging |
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.
I need to switch this back before merging.
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.
Quick request to update the types.
Summary
The API v2 client is unopinionated. It accepts configuration options that are a 1:1 representation of the API configuration options. It also doesn't preprocess the results -- that's left to the consumer. This will make it easier for folks who are familiar with the API or reading the API docs to map concepts to the client.
To-do
Bug fixes
New features
onStreamEvent
handler.streamQueryV2
returns{ cancelStream }
which can be used to cancel the stream.Breaking changes
Package interface is now:
The API has been dramatically simplified and ergonomics much improved, so I don't think we need to inject any opinions or sugar into the interface. As a result, requests are now configured with the same objects and fields as described in the Corpus Query docs.
StreamEvent
now has this shape:References
https://javascript.info/fetch-abort
whatwg/streams#1255
https://github.com/openai/openai-node/blob/master/src/streaming.ts