Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference
{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}
Options that can be provided per-request. Extends the base RequestOptions (like timeout
and baseUrl
) with request-specific controls like cancellation via AbortSignal
.
Options specified here will override any default RequestOptions configured on a model (e.g. GenerativeModel).
Signature:
export interface SingleRequestOptions extends RequestOptions
Extends: RequestOptions
Property | Type | Description |
---|---|---|
signal | AbortSignal | An AbortSignal instance that allows cancelling ongoing requests (like generateContent or generateImages ).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. |
An AbortSignal
instance that allows cancelling ongoing requests (like generateContent
or generateImages
).
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.
Signature:
signal?: AbortSignal;
const controller = new AbortController();
const model = getGenerativeModel({
// ...
});
// To cancel request:
controller.abort();