Skip to content
1 min read · 216 words

@nhtio/adk/batteries/generation/openai/types

Option and wire-shape types for the OpenAI media generation adapter, plus the shared generation battery base type both current and future generation batteries build on.

Remarks

This module owns the shared generation option base (BaseGenerationAdapterOptions) and the shared call shapes (GenerateOptions, EditOptions). Future generation batteries (Gemini, transformers.js) re-export and extend these rather than redefining them, so every generation battery differs only in its engine — exactly how the WebLLM Embeddings battery extends the OpenAI Embeddings option type.

Interfaces

InterfaceDescription
BaseGenerationAdapterOptionsOptions shared by every generation battery, regardless of engine.
EditOptionsOptions shared by every generation battery's edit call, regardless of engine.
GenerateOptionsOptions shared by every generation battery's generate call, regardless of engine.
GenerationRetryConfigRetry/backoff configuration for HTTP-backed generation batteries. Mirrors the embeddings battery's EmbeddingsRetryConfig so behavior is consistent across the bundled batteries.
OpenAIEditOptionsPer-call options accepted by @nhtio/adk/batteries/generation/openai/adapter!OpenAIGenerationAdapter.edit.
OpenAIGenerateOptionsPer-call options accepted by @nhtio/adk/batteries/generation/openai/adapter!OpenAIGenerationAdapter.generate.
OpenAIGenerationAdapterOptionsConstructor options for @nhtio/adk/batteries/generation/openai/adapter!OpenAIGenerationAdapter.
OpenAIImagesGenerationRequestBodyThe JSON request body POSTed to /v1/images/generations.
OpenAIImagesResponseThe relevant subset of the /v1/images/generations and /v1/images/edits JSON response shape.

References

GeneratedMediaOutput

Re-exports GeneratedMediaOutput