AttachmentPrompt Class

public class AttachmentPrompt
extends Prompt<java.util.List<Attachment>>

Prompts a user to upload attachments, like images.

Constructor Summary

Constructor Description
AttachmentPrompt(String dialogId)

Initializes a new instance of the AttachmentPrompt class.

AttachmentPrompt(String dialogId, PromptValidator<List<Attachment>> validator)

Initializes a new instance of the AttachmentPrompt class.

Method Summary

Modifier and Type Method and Description
protected java.util.concurrent.CompletableFuture<java.lang.Void> onPrompt(TurnContext turnContext, Map<String,Object> state, PromptOptions options, Boolean isRetry)

Prompts the user for input.

protected java.util.concurrent.CompletableFuture<PromptRecognizerResult<java.util.List<Attachment>>> onRecognize(TurnContext turnContext, Map<String,Object> state, PromptOptions options)

Attempts to recognize the user's input.

Methods inherited from Dialog

Methods inherited from Prompt

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

AttachmentPrompt

public AttachmentPrompt(String dialogId)

Initializes a new instance of the AttachmentPrompt class.

Parameters:

dialogId - The ID to assign to this prompt. The value of dialogId must be unique within the DialogSet or ComponentDialog to which the prompt is added.

AttachmentPrompt

public AttachmentPrompt(String dialogId, PromptValidator> validator)

Initializes a new instance of the AttachmentPrompt class.

Parameters:

dialogId - The ID to assign to this prompt.
validator - Optional, a PromptValidator<T> that contains additional, custom validation for this prompt. The value of dialogId must be unique within the DialogSet or ComponentDialog to which the prompt is added.

Method Details

onPrompt

protected CompletableFuture onPrompt(TurnContext turnContext, Map state, PromptOptions options, Boolean isRetry)

Prompts the user for input.

Overrides:

AttachmentPrompt.onPrompt(TurnContext turnContext, Map<String,Object> state, PromptOptions options, Boolean isRetry)

Parameters:

turnContext - Context for the current turn of conversation with the user.
state - Contains state for the current instance of the prompt on the dialog stack.
options - A prompt options Object constructed from the options initially provided in the call to DialogContext(String, PromptOptions) .
isRetry - true if this is the first time this prompt dialog instance on the stack is prompting the user for input; otherwise, false.

Returns:

A CompletableFuture representing the asynchronous operation.

onRecognize

protected CompletableFuture>> onRecognize(TurnContext turnContext, Map state, PromptOptions options)

Attempts to recognize the user's input.

Overrides:

AttachmentPrompt.onRecognize(TurnContext turnContext, Map<String,Object> state, PromptOptions options)

Parameters:

turnContext - Context for the current turn of conversation with the user.
state - Contains state for the current instance of the prompt on the dialog stack.
options - A prompt options Object constructed from the options initially provided in the call to DialogContext(String, PromptOptions) .

Returns:

A CompletableFuture representing the asynchronous operation. If the task is successful, the result describes the result of the recognition attempt.

Applies to