KtorOpenAiGenerationApi

class KtorOpenAiGenerationApi(val httpClient: HttpClient, val baseUrl: String) : OpenAiGenerationApi(source)

Ktor implementation of OpenAI validation and image generation with traffic accounting.

Author

Dmitriy Moroz

Parameters

httpClient

Configured Ktor client used to send provider requests.

baseUrl

OpenAI API base URL.

Constructors

Link copied to clipboard
constructor(httpClient: HttpClient, baseUrl: String)
constructor(baseUrl: String)

Creates a new SDAI component instance.

Types

Link copied to clipboard
private object Companion

Provides the companion object singleton used by the SDAI network layer.

Properties

Link copied to clipboard
private val baseUrl: String

Exposes the baseUrl value used by the SDAI network layer.

Link copied to clipboard
private val httpClient: HttpClient

Exposes the httpClient value used by the SDAI network layer.

Functions

Link copied to clipboard
open suspend override fun generateImage(apiKey: String, request: OpenAiRequest): OpenAiResponse

Executes the generateImage step in the SDAI network layer.

Link copied to clipboard
open suspend override fun validateBearerToken(apiKey: String)

Executes the validateBearerToken step in the SDAI network layer.