Skip to main content

Crate kcode_openai_api

Crate kcode_openai_api 

Source
Expand description

OpenAI audio transcription and GPT Image generation.

OpenAi owns an API key and exposes the direct OpenAI API operations currently needed by Kennedy: gpt-4o-transcribe audio transcription and gpt-image-2 image generation. The crate does not persist credentials, requests, responses, or generated media.

Structs§

AudioInput
One in-memory audio file accepted by gpt-4o-transcribe.
GeneratedImage
One generated image held in memory.
ImageGeneration
Normalized single-image GPT Image 2 result.
ImageGenerationRequest
One GPT Image 2 text-to-image request.
ImageTokenDetails
Text and image token detail for GPT Image usage.
ImageUsage
Token usage returned by GPT Image.
OpenAi
Cloneable asynchronous OpenAI client for transcription and image generation.
Transcription
Normalized gpt-4o-transcribe result.
TranscriptionRequest
One audio transcription request.
TranscriptionTokenDetails
Modality detail for token-billed audio transcription input.
TranscriptionTokenUsage
Token-billed transcription usage.

Enums§

Error
A local validation, transport, provider, or protocol failure.
ImageBackground
Background selection supported by GPT Image 2.
ImageFormat
GPT Image output file format.
ImageQuality
GPT Image rendering quality.
ImageSize
Generated image dimensions.
Moderation
Provider content-moderation level.
TranscriptionUsage
Usage returned for a transcription request.

Constants§

DEFAULT_TRANSCRIPTION_PROMPT
Default transcription guidance preserving Kennedy’s current behavior.
GPT_4O_TRANSCRIBE
OpenAI model used for audio transcription.
GPT_IMAGE_2
Latest GPT Image model used for image generation.

Type Aliases§

Result
The result type returned by this crate.