Class OpenAIModelResponse
java.lang.Object
org.apache.beam.sdk.ml.inference.openai.OpenAIModelResponse
- All Implemented Interfaces:
Serializable,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 Summary
Modifier and TypeMethodDescriptionstatic OpenAIModelResponseCreates a new response instance with the specified output text.Returns the text output from the model.
-
Method Details
-
getModelResponse
Returns the text output from the model.- Returns:
- the output text string
-
create
Creates a new response instance with the specified output text.- Parameters:
output- the text returned by the model- Returns:
- a new
OpenAIModelResponseinstance
-