Conversation
🦋 Changeset detectedLatest commit: 3a63e57 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
496add1 to
f9950ce
Compare
Changeset File Check ✅
|
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1Affected Products
Test Logs |
b9a363a to
3e0cc6b
Compare
b3e7dd8 to
c616128
Compare
DellaBitta
left a comment
There was a problem hiding this comment.
Looks good, but won't approve until council review.
|
|
||
| If provided, calling `abort()` on the corresponding `AbortController` will attempt to cancel the underlying HTTP request. An `AbortError` will be thrown if cancellation is successful. | ||
|
|
||
| Note that this will not cancel the request in the backend, so billing will still be applied despite cancellation. |
|
Re-requesting review since changes were made. |
hsubox76
left a comment
There was a problem hiding this comment.
Weren't we going to have the iterator throw too if there was an error on that iteration? Does this do that? Did it already do that?
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for AbortSignal across various methods, allowing for cancellation of in-flight requests. The implementation is robust, using AbortSignal.any() to gracefully handle both user-initiated aborts and internal timeouts. The changes are well-tested with new integration and unit tests. I've left a few comments on potential improvements, mainly around ensuring atomicity of history updates in ChatSession to prevent inconsistent states, and a couple of minor cleanup items in generated documentation files. Overall, this is a great addition to the SDK.
common/api-review/ai.api.md
Outdated
| generateContent(templateId: string, templateVariables: object, // anything! | ||
| singleRequestOptions?: SingleRequestOptions): Promise<GenerateContentResult>; |
There was a problem hiding this comment.
There appears to be a leftover comment // anything! in the generateContent method signature. This should be removed for clarity in the public API documentation.
| generateContent(templateId: string, templateVariables: object, // anything! | |
| singleRequestOptions?: SingleRequestOptions): Promise<GenerateContentResult>; | |
| generateContent(templateId: string, templateVariables: object, singleRequestOptions?: SingleRequestOptions): Promise<GenerateContentResult>; |
| generateContent(templateId: string, templateVariables: object, // anything! | ||
| singleRequestOptions?: SingleRequestOptions): Promise<GenerateContentResult>; |
There was a problem hiding this comment.
Similar to the API report file, there's a leftover comment // anything! in the generateContent method signature in this documentation file. It should be removed.
| generateContent(templateId: string, templateVariables: object, // anything! | |
| singleRequestOptions?: SingleRequestOptions): Promise<GenerateContentResult>; | |
| generateContent(templateId: string, templateVariables: object, singleRequestOptions?: SingleRequestOptions): Promise<GenerateContentResult>; |
hsubox76
left a comment
There was a problem hiding this comment.
LG, thanks for adding the comments and the tests.
Add an
AbortSignalto a newSingleRequestOptionsthat can be passed to all methods that make requests to the backend, allowing them to be aborted.Fixes #8859
API Proposal: go/vinf-abort-request-api (internal)