KtorHuggingFaceGenerationApi

class KtorHuggingFaceGenerationApi(val httpClient: HttpClient, val apiBaseUrl: String, val inferenceBaseUrl: String, val json: Json = defaultNetworkJson) : HuggingFaceGenerationApi(source)

Coordinates KtorHuggingFaceGenerationApi behavior in the SDAI network layer.

Author

Dmitriy Moroz

Constructors

Link copied to clipboard
constructor(httpClient: HttpClient, apiBaseUrl: String, inferenceBaseUrl: String, json: Json = defaultNetworkJson)
constructor(apiBaseUrl: String, inferenceBaseUrl: String)

Types

Link copied to clipboard
private object Companion

Properties

Link copied to clipboard
private val apiBaseUrl: String

Exposes the apiBaseUrl 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.

Link copied to clipboard

Exposes the inferenceBaseUrl value used by the SDAI network layer.

Link copied to clipboard
private val json: Json

Exposes the json value used by the SDAI network layer.

Functions

Link copied to clipboard
open suspend override fun generate(apiKey: String, model: String, request: HuggingFaceGenerationRequest): ByteArray

Executes the generate step in the SDAI network layer.

Link copied to clipboard
private suspend fun <T> retryServiceUnavailable(block: suspend () -> T): T
Link copied to clipboard
open suspend override fun validateBearerToken(apiKey: String)

Executes the validateBearerToken step in the SDAI network layer.