TextGenerationRequest Class

  • java.lang.Object
    • com.microsoft.semantickernel.aiservices.huggingface.models.TextGenerationRequest

public class TextGenerationRequest

Represents a request to generate text using the Hugging Face API.

Constructor Summary

Constructor Description
TextGenerationRequest(String inputs, boolean stream, TextGenerationRequest.HuggingFaceTextParameters parameters, TextGenerationRequest.HuggingFaceTextOptions options)

Create a new instance of TextGenerationRequest.

Method Summary

Modifier and Type Method and Description
static TextGenerationRequest fromPromptAndExecutionSettings(String prompt, HuggingFacePromptExecutionSettings executionSettings)

Create a new instance of TextGenerationRequest.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

TextGenerationRequest

public TextGenerationRequest(String inputs, boolean stream, TextGenerationRequest.HuggingFaceTextParameters parameters, TextGenerationRequest.HuggingFaceTextOptions options)

Create a new instance of TextGenerationRequest.

Parameters:

inputs - The input string to generate text for.
stream - Enable streaming.
parameters - Parameters used by the model for generation.
options - Options used by the model for generation.

Method Details

fromPromptAndExecutionSettings

public static TextGenerationRequest fromPromptAndExecutionSettings(String prompt, HuggingFacePromptExecutionSettings executionSettings)

Create a new instance of TextGenerationRequest.

Parameters:

prompt - The prompt to generate text for.
executionSettings - The settings for executing the prompt.

Returns:

A new instance of TextGenerationRequest.

Applies to