跳到主要内容

api-openai

自动收集自 lib/api/api-openai/README.md

OpenAI REST API contracts for KCloud application-layer implementations.

Source

Usage

dependencies {
implementation(project(":lib:api:api-openai"))
}

The interfaces are intentionally implementation-free. REST paths are fixed in OpenAiApiPaths and used directly by the Ktorfit annotations on each method.

Request and response schemas are generated as Kotlin serialization DTOs under site.addzero.kcloud.api.openai.models. Application modules implement the interfaces against concrete request and response types such as CreateChatCompletionRequest, CreateChatCompletionResponse, CreateResponse, and Response.

JsonElement remains only as a field-level or named typealias fallback when the OpenAPI schema does not expose a fixed serializable object shape.

Regeneration

python3 lib/api/api-openai/scripts/generate-openai-api.py
./gradlew :lib:api:api-openai:compileKotlinJvm --rerun-tasks

Maven / Gradle

已发布至 Maven Central。

implementation("site.addzero:api-openai:latest version")
<dependency>
<groupId>site.addzero</groupId>
<artifactId>api-openai</artifactId>
<version>latest version</version>
</dependency>