Class TextGenerationInferenceApi

java.lang.Object
org.springframework.ai.huggingface.api.TextGenerationInferenceApi

@Generated(value="io.swagger.codegen.v3.generators.java.JavaClientCodegen", date="2023-11-15T11:37:42.297563829Z[Etc/UTC]") @Component("org.springframework.ai.huggingface.api.TextGenerationInferenceApi") public class TextGenerationInferenceApi extends Object
  • Constructor Details

    • TextGenerationInferenceApi

      public TextGenerationInferenceApi()
    • TextGenerationInferenceApi

      @Autowired public TextGenerationInferenceApi(ApiClient apiClient)
  • Method Details

    • getApiClient

      public ApiClient getApiClient()
    • setApiClient

      public void setApiClient(ApiClient apiClient)
    • compatGenerate

      public GenerateResponse compatGenerate(CompatGenerateRequest body) throws org.springframework.web.client.RestClientException
      Generate tokens if `stream == false` or a stream of token if `stream == true` Generate tokens if `stream == false` or a stream of token if `stream == true`

      200 - Generated Text

      422 - Input validation error

      424 - Generation Error

      429 - Model is overloaded

      500 - Incomplete generation

      Parameters:
      body - (required)
      Returns:
      GenerateResponse
      Throws:
      org.springframework.web.client.RestClientException - if an error occurs while attempting to invoke the API
    • compatGenerateWithHttpInfo

      public org.springframework.http.ResponseEntity<GenerateResponse> compatGenerateWithHttpInfo(CompatGenerateRequest body) throws org.springframework.web.client.RestClientException
      Generate tokens if `stream == false` or a stream of token if `stream == true` Generate tokens if `stream == false` or a stream of token if `stream == true`

      200 - Generated Text

      422 - Input validation error

      424 - Generation Error

      429 - Model is overloaded

      500 - Incomplete generation

      Parameters:
      body - (required)
      Returns:
      ResponseEntity<GenerateResponse>
      Throws:
      org.springframework.web.client.RestClientException - if an error occurs while attempting to invoke the API
    • generate

      public GenerateResponse generate(GenerateRequest body) throws org.springframework.web.client.RestClientException
      Generate tokens Generate tokens

      200 - Generated Text

      422 - Input validation error

      424 - Generation Error

      429 - Model is overloaded

      500 - Incomplete generation

      Parameters:
      body - (required)
      Returns:
      GenerateResponse
      Throws:
      org.springframework.web.client.RestClientException - if an error occurs while attempting to invoke the API
    • generateWithHttpInfo

      public org.springframework.http.ResponseEntity<GenerateResponse> generateWithHttpInfo(GenerateRequest body) throws org.springframework.web.client.RestClientException
      Generate tokens Generate tokens

      200 - Generated Text

      422 - Input validation error

      424 - Generation Error

      429 - Model is overloaded

      500 - Incomplete generation

      Parameters:
      body - (required)
      Returns:
      ResponseEntity<GenerateResponse>
      Throws:
      org.springframework.web.client.RestClientException - if an error occurs while attempting to invoke the API
    • generateStream

      public StreamResponse generateStream(GenerateRequest body) throws org.springframework.web.client.RestClientException
      Generate a stream of token using Server-Sent Events Generate a stream of token using Server-Sent Events

      200 - Generated Text

      422 - Input validation error

      424 - Generation Error

      429 - Model is overloaded

      500 - Incomplete generation

      Parameters:
      body - (required)
      Returns:
      StreamResponse
      Throws:
      org.springframework.web.client.RestClientException - if an error occurs while attempting to invoke the API
    • generateStreamWithHttpInfo

      public org.springframework.http.ResponseEntity<StreamResponse> generateStreamWithHttpInfo(GenerateRequest body) throws org.springframework.web.client.RestClientException
      Generate a stream of token using Server-Sent Events Generate a stream of token using Server-Sent Events

      200 - Generated Text

      422 - Input validation error

      424 - Generation Error

      429 - Model is overloaded

      500 - Incomplete generation

      Parameters:
      body - (required)
      Returns:
      ResponseEntity<StreamResponse>
      Throws:
      org.springframework.web.client.RestClientException - if an error occurs while attempting to invoke the API
    • getModelInfo

      public Info getModelInfo() throws org.springframework.web.client.RestClientException
      Text Generation Inference endpoint info Text Generation Inference endpoint info

      200 - Served model info

      Returns:
      Info
      Throws:
      org.springframework.web.client.RestClientException - if an error occurs while attempting to invoke the API
    • getModelInfoWithHttpInfo

      public org.springframework.http.ResponseEntity<Info> getModelInfoWithHttpInfo() throws org.springframework.web.client.RestClientException
      Text Generation Inference endpoint info Text Generation Inference endpoint info

      200 - Served model info

      Returns:
      ResponseEntity<Info>
      Throws:
      org.springframework.web.client.RestClientException - if an error occurs while attempting to invoke the API
    • health

      public void health() throws org.springframework.web.client.RestClientException
      Health check method Health check method

      200 - Everything is working fine

      503 - Text generation inference is down

      Throws:
      org.springframework.web.client.RestClientException - if an error occurs while attempting to invoke the API
    • healthWithHttpInfo

      public org.springframework.http.ResponseEntity<Void> healthWithHttpInfo() throws org.springframework.web.client.RestClientException
      Health check method Health check method

      200 - Everything is working fine

      503 - Text generation inference is down

      Returns:
      ResponseEntity<Void>
      Throws:
      org.springframework.web.client.RestClientException - if an error occurs while attempting to invoke the API
    • metrics

      public String metrics() throws org.springframework.web.client.RestClientException
      Prometheus metrics scrape endpoint Prometheus metrics scrape endpoint

      200 - Prometheus Metrics

      Returns:
      String
      Throws:
      org.springframework.web.client.RestClientException - if an error occurs while attempting to invoke the API
    • metricsWithHttpInfo

      public org.springframework.http.ResponseEntity<String> metricsWithHttpInfo() throws org.springframework.web.client.RestClientException
      Prometheus metrics scrape endpoint Prometheus metrics scrape endpoint

      200 - Prometheus Metrics

      Returns:
      ResponseEntity<String>
      Throws:
      org.springframework.web.client.RestClientException - if an error occurs while attempting to invoke the API