Skip to content
Commit Detail

Commit b2ba62c

Author
samscott89 <samscott89@users.noreply.github.com> 2026-04-09 13:11:55 -0500
Parents
8e75c36
Tree
a01c546
feat(types): add overload-based AI.run() with gateway fallback and gemma-4

Add overload-based run() signatures for better type inference:
- Batch request (queueRequest: true) -> AsyncResponse
- Raw response (returnRawResponse: true) -> Response
- WebSocket (websocket: true) -> Response
- Streaming (stream: true in inputs) -> ReadableStream
- Normal -> model-specific output type
- Unknown model (gateway fallback) -> Record<string, unknown>

The gateway fallback allows AI Gateway models (e.g. 'google/nano-banana')
to be called without type errors while preserving full type safety for
known Cloudflare AI models.

Also adds gemma-4-26b-a4b-it model types and type-check tests.

Files changed

2 files changed+1 added~1 modified