Class OpenAIModelResponse

java.lang.Object
org.apache.beam.sdk.ml.inference.openai.OpenAIModelResponse
All Implemented Interfaces:
Serializable, BaseResponse

public class OpenAIModelResponse extends Object implements BaseResponse
Response from OpenAI model inference results.

This class encapsulates the text output returned from OpenAI models..

Example Usage


 OpenAIModelResponse response = OpenAIModelResponse.create("Bonjour");
 String output = response.getModelResponse(); // "Bonjour"
 
See Also:
  • Method Details

    • getModelResponse

      public String getModelResponse()
      Returns the text output from the model.
      Returns:
      the output text string
    • create

      public static OpenAIModelResponse create(String output)
      Creates a new response instance with the specified output text.
      Parameters:
      output - the text returned by the model
      Returns:
      a new OpenAIModelResponse instance