You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to be able to cancel an ongoing request when using generateContent() in firebase/vertexai by passing an AbortSignal as an option.
Currently, generateContent() only accepts a single parameter (the prompt). There is no way to pass an AbortSignal to cancel a request.
No errors are thrown, but there is no way to stop an ongoing request, leading to unnecessary API calls continuing even when they are no longer needed.
Steps and code to reproduce issue
`
// ...
if (this.controller) this.controller.abort();
this.controller = new AbortController();
const signal = this.controller.signal;
try {
const result = await this.getModel().generateContent(prompt, { signal }); // Passing abort signal here
return result;
} catch (error) {
console.error("Request aborted or failed:", error);
}
// ...
`
Expected Behavior
I would like generateContent() to accept a second parameter, such as an options object, where we can pass an AbortSignal to cancel the request when needed.
Feature Request
Please add support for an options object in generateContent() that allows passing an AbortSignal to cancel requests. This would align with best practices for handling long-running network requests and improve app responsiveness.
The text was updated successfully, but these errors were encountered:
Operating System
macOS 15.3.2
Environment (if applicable)
ReactJS
Firebase SDK Version
11.5.0
Firebase SDK Product(s)
VertexAI
Project Tooling
ReactJS App with Vite
Detailed Problem Description
Steps and code to reproduce issue
`
`
Expected Behavior
I would like generateContent() to accept a second parameter, such as an options object, where we can pass an AbortSignal to cancel the request when needed.
Feature Request
Please add support for an options object in generateContent() that allows passing an AbortSignal to cancel requests. This would align with best practices for handling long-running network requests and improve app responsiveness.
The text was updated successfully, but these errors were encountered: