DeepSeekClientBase

abstract class DeepSeekClientBase(client: HttpClient, val config: DeepSeekClientConfig)

Base class for DeepSeek API clients providing core functionality.

This abstract class serves as a foundation for both standard and streaming DeepSeek clients, handling HTTP interactions and common configuration.

The client is designed to be long-lived: create one instance and reuse it for the lifetime of your application. The underlying HTTP client automatically releases idle connections and threads, so calling close is usually unnecessary.

Inheritors

Constructors

Link copied to clipboard
constructor(client: HttpClient, config: DeepSeekClientConfig)

Types

Link copied to clipboard
abstract class Builder(token: String? = null)

Base builder class for configuring DeepSeek clients.

Properties

Link copied to clipboard

Configuration options for the DeepSeek client

Functions

Link copied to clipboard

Sends a chat completion request to the DeepSeek API.

Link copied to clipboard

Streams chat completion responses chunk by chunk from the DeepSeek API.

Link copied to clipboard
open fun close()

Closes the underlying HTTP client and releases its resources.

Link copied to clipboard
open suspend fun closeAndJoin()

Closes the underlying HTTP client and suspends until its coroutine scope completes.

Link copied to clipboard

Sends a request to the Responses API.

Link copied to clipboard

Streams a Responses API call as semantic server-sent events.

Link copied to clipboard

Deletes a stored file.

Link copied to clipboard

Sends a Fill-In-the-Middle (FIM) completion request to the DeepSeek API.

Link copied to clipboard

Streams Fill-In-the-Middle (FIM) completions chunk by chunk from the DeepSeek API.

Link copied to clipboard
suspend fun DeepSeekClientBase.listFiles(after: String? = null, limit: Int? = null, order: SortOrder? = null, purpose: FilePurpose? = null): FileList

Lists stored files, oldest first, one page at a time.

Link copied to clipboard

Retrieves the list of DeepSeek models available for the current API key.

Link copied to clipboard

Fetches the metadata of a single stored file.

Link copied to clipboard
suspend fun DeepSeekClientBase.uploadFile(bytes: ByteArray, filename: String, expiresAfterSeconds: Int? = null): FileObject

Uploads an image for a vision model to read, and returns the stored FileObject.

Link copied to clipboard

Retrieves the current user's available API balance.