CloudflareModelFactory

constructor(accountId: String, apiKey: Supplier<String?>, restClientBuilder: <Error class: unknown class>? = null, observationRegistry: <Error class: unknown class> = ObservationRegistry.NOOP, defaultModel: String = CLEF, maxResponseBytes: Int = SystemOneEndpoint.DEFAULT_MAX_RESPONSE_BYTES)

Parameters

accountId

the Cloudflare account that runs the models, 32 hexadecimal characters

apiKey

supplies the API key (a Cloudflare API token) with Workers AI access for each call

restClientBuilder

the application's HTTP client builder, or null for the factory's own

observationRegistry

records decision and request observations

defaultModel

the model build and buildValidated return

maxResponseBytes

the largest response body that is read