Skip to content

Interface: GeminiHttpTransport ​

Defined in: gemini/src/driver/gemini-http-transport.ts:10

Injectable HTTP transport port for dispatching Google Gemini generateContent requests.

Allows GeminiModelDriver to execute against either the production fetch transport or deterministic recorded transport fixtures in unit and integration tests.

Methods ​

sendGenerateContentRequest() ​

ts
sendGenerateContentRequest(request): Promise<GeminiHttpResponse>;

Defined in: gemini/src/driver/gemini-http-transport.ts:23

Sends a single /v1beta/models/{model}:generateContent POST request and returns the parsed response.

Implementations must honor request.signal and return status 429 with resetAtMs rather than swallowing rate-limit responses so PoolManager can fail over across seats.

Parameters ​

ParameterTypeDescription
requestGeminiHttpRequestWire-formatted Gemini generateContent request.

Returns ​

Promise<GeminiHttpResponse>

HTTP status code, response body, and optional rate-limit reset timestamp.

Throws ​

If request.signal is aborted or an unrecoverable transport error occurs.

Released under the MIT License.