Class DeepSeekClient

java.lang.Object
de.entwicklertraining.api.base.ApiClient
de.entwicklertraining.deepseek4j.DeepSeekClient

public final class DeepSeekClient extends de.entwicklertraining.api.base.ApiClient
DeepSeekClient handles HTTP requests to the DeepSeek Chat Completion API, including exponential backoff for 429 (Rate Limit) and 503 (Server Overloaded).

Error behavior: - 400 -> throw HTTP_400_RequestRejectedException - 401 -> throw HTTP_401_AuthorizationException - 402 -> throw HTTP_402_PaymentRequiredException - 422 -> throw HTTP_422_UnprocessableEntityException - 429 -> attempt exponential backoff; if still not resolved after max tries -> throw HTTP_429_RateLimitOrQuotaException - 500 -> throw HTTP_500_ServerErrorException - 503 -> attempt exponential backoff; if still not resolved after max tries -> throw HTTP_503_ServerUnavailableException - else -> throw ApiClientException

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
    static class 
     

    Nested classes/interfaces inherited from class de.entwicklertraining.api.base.ApiClient

    de.entwicklertraining.api.base.ApiClient.ApiClientException, de.entwicklertraining.api.base.ApiClient.ApiResponseUnusableException, de.entwicklertraining.api.base.ApiClient.ApiTimeoutException, de.entwicklertraining.api.base.ApiClient.HTTP_400_RequestRejectedException, de.entwicklertraining.api.base.ApiClient.HTTP_401_AuthorizationException, de.entwicklertraining.api.base.ApiClient.HTTP_402_PaymentRequiredException, de.entwicklertraining.api.base.ApiClient.HTTP_403_PermissionDeniedException, de.entwicklertraining.api.base.ApiClient.HTTP_404_NotFoundException, de.entwicklertraining.api.base.ApiClient.HTTP_422_UnprocessableEntityException, de.entwicklertraining.api.base.ApiClient.HTTP_429_RateLimitOrQuotaException, de.entwicklertraining.api.base.ApiClient.HTTP_500_ServerErrorException, de.entwicklertraining.api.base.ApiClient.HTTP_503_ServerUnavailableException, de.entwicklertraining.api.base.ApiClient.HTTP_504_ServerTimeoutException, de.entwicklertraining.api.base.ApiClient.StatusCodeExceptionRegistration
  • Field Summary

    Fields inherited from class de.entwicklertraining.api.base.ApiClient

    httpClient, settings
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    DeepSeekClient(de.entwicklertraining.api.base.ApiClientSettings settings)
     
    DeepSeekClient(de.entwicklertraining.api.base.ApiClientSettings settings, String customBaseUrl)
     
  • Method Summary

    Methods inherited from class de.entwicklertraining.api.base.ApiClient

    applySleep, calculateNextSleep, createRetriesExhaustedException, createTimeoutException, executeWithRetry, executeWithTimeout, getBaseUrl, maybeAdjustSleepForFinalRetry, registerStatusCodeException, runRequest, sendRequest, sendRequestWithExponentialBackoff, setBaseUrl

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DeepSeekClient

      public DeepSeekClient()
    • DeepSeekClient

      public DeepSeekClient(de.entwicklertraining.api.base.ApiClientSettings settings)
    • DeepSeekClient

      public DeepSeekClient(de.entwicklertraining.api.base.ApiClientSettings settings, String customBaseUrl)
  • Method Details