Package-level declarations

Types

Link copied to clipboard
@Serializable
@SerialName(value = "assistant")
open class AssistantMessage(val content: String?, val name: String? = null, val prefix: Boolean? = null, val reasoningContent: String? = null) : ChatMessage
Link copied to clipboard
@Serializable
class BalanceInfo(val currency: CurrencyType, val totalBalance: String, val grantedBalance: String, val toppedUpBalance: String)
Link copied to clipboard
@Serializable
class ChatChoice(val finishReason: FinishReason, val index: Long, val message: ChatCompletionMessage, val logprobs: LogProbs? = null)
Link copied to clipboard
@Serializable
class ChatChoiceChunk(val delta: AssistantMessage, val finishReason: FinishReason?, val index: Long)
Link copied to clipboard
@Serializable
class ChatCompletion(val id: String, val choices: List<ChatChoice>, val created: Long, val model: String, val systemFingerprint: String? = null, val object: String, val usage: Usage)

Represents the Chat Completion.

Link copied to clipboard
@Serializable
class ChatCompletionChunk(val id: String, val choices: List<ChatChoiceChunk>, val created: Long, val model: String, val systemFingerprint: String, val object: String, val usage: Usage? = null)
Link copied to clipboard
@SerialName(value = "assistant")
class ChatCompletionMessage(val content: String?, val reasoningContent: String? = null, val toolCalls: List<ToolCall>? = null) : AssistantMessage
Link copied to clipboard
Link copied to clipboard

Parameters for configuring chat completion requests to DeepSeek models.

Link copied to clipboard
@Serializable
class ChatCompletionRequest(val messages: List<ChatMessage>, val model: ChatModel, val frequencyPenalty: Double? = null, val maxTokens: Int? = null, val presencePenalty: Double? = null, val responseFormat: ResponseFormat? = null, val stop: StopReason? = null, val stream: Boolean? = null, val streamOptions: StreamOptions? = null, val temperature: Double? = null, val topP: Double? = null, val tools: List<Tool>? = null, val toolChoice: ToolChoice? = null, val logprobs: Boolean? = null, val topLogprobs: Int? = null)

Represents the Chat Completion request

Link copied to clipboard
@Serializable
sealed interface ChatMessage
Link copied to clipboard
Link copied to clipboard
@Serializable
class CompletionTokenDetails(val reasoningTokens: Int)
Link copied to clipboard
Link copied to clipboard
open class DeepSeekParams

Base class for DeepSeek API parameters.

Link copied to clipboard
@Serializable
class FIMChoice(val text: String, val index: Int, val finishReason: FinishReason? = null, val logprobs: FIMLogProbs? = null)
Link copied to clipboard
@Serializable
class FIMCompletion(val id: String, val choices: List<FIMChoice>, val created: Long, val model: String, val systemFingerprint: String? = null, val object: String, val usage: Usage? = null)

Represents the FIM (Fill-In-the-Middle) Completion.

Link copied to clipboard

Parameters for configuring Fill-in-the-Middle (FIM) completion requests to DeepSeek models.

Link copied to clipboard
@Serializable
class FIMCompletionRequest(val model: ChatModel, val prompt: String, val echo: Boolean? = null, val frequencyPenalty: Double? = null, val logprobs: Int? = null, val maxTokens: Int? = null, val presencePenalty: Double? = null, val stop: StopReason? = null, val stream: Boolean? = null, val streamOptions: StreamOptions? = null, val suffix: String? = null, val temperature: Double? = null, val topP: Double? = null)

Represents the FIM (Fill-In-the-Middle) Completion request

Link copied to clipboard
@Serializable
class FIMLogProbs(val textOffset: List<Int>, val tokenLogprobs: List<Double>, val tokens: List<String>, val topLogprobs: List<TopLogProb>?)
Link copied to clipboard
@Serializable
enum FinishReason : Enum<FinishReason>
Link copied to clipboard
@Serializable
class FunctionRequest(val name: String, val description: String?, val parameters: JsonObject?) : ToolFunction
Link copied to clipboard
@Serializable
class FunctionResponse(val name: String, val arguments: JsonObject?) : ToolFunction
Link copied to clipboard
@Serializable
class ListsModels(val object: String, val data: List<ModelInfo>)
Link copied to clipboard
@Serializable
class LogProb(val token: String, val logprob: Double, val bytes: List<Int>?, val topLogprobs: List<TopLogProb>)
Link copied to clipboard
@Serializable
class LogProbs(val content: List<LogProb>?)
Link copied to clipboard
@Serializable
class ModelInfo(val id: String, val object: ModelObjectType, val ownedBy: String)
Link copied to clipboard
@Serializable
enum ModelObjectType : Enum<ModelObjectType>
Link copied to clipboard
@Serializable
class ResponseFormat
Link copied to clipboard
@Serializable(with = StopReasoningSerializer::class)
class StopReason(val reasons: List<String>)
Link copied to clipboard
@Serializable
class StreamOptions(val includeOptions: Boolean)

Represents options that can be applied to a streaming request.

Link copied to clipboard
@Serializable
@SerialName(value = "system")
class SystemMessage(val content: String, val name: String? = null) : ChatMessage
Link copied to clipboard
@Serializable
class Tool(val type: ToolCallType, val function: FunctionRequest)
Link copied to clipboard
@Serializable
class ToolCall(val id: String, val type: ToolCallType, val function: FunctionResponse)
Link copied to clipboard
@Serializable
enum ToolCallType : Enum<ToolCallType>
Link copied to clipboard
@Serializable(with = ToolChoiceSerializer::class)
sealed interface ToolChoice
Link copied to clipboard
@Serializable(with = ToolFunctionSerializer::class)
sealed interface ToolFunction
Link copied to clipboard
@Serializable
@SerialName(value = "tool")
class ToolMessage(val content: String, val toolCallId: String) : ChatMessage
Link copied to clipboard
@Serializable
class TopLogProb(val token: String, val logprob: Double, val bytes: List<Int>?)
Link copied to clipboard
@Serializable
class Usage(val completionTokens: Int, val promptTokens: Int, val promptCacheHitTokens: Int? = null, val promptCacheMissTokens: Int? = null, val totalTokens: Int, val completionTokensDetails: CompletionTokenDetails? = null)
Link copied to clipboard
@Serializable
class UserBalance(val isAvailable: Boolean, val balanceInfos: List<BalanceInfo>)
Link copied to clipboard
@Serializable
@SerialName(value = "user")
class UserMessage(val content: String?, val name: String? = null) : ChatMessage

Functions

Link copied to clipboard

Creates chat completion parameters using a builder pattern.

Link copied to clipboard

Creates streaming chat completion parameters using a builder pattern.

Link copied to clipboard

Creates FIM completion parameters using a builder pattern.

Link copied to clipboard

Creates streaming FIM completion parameters using a builder pattern.