forked from github/copilot-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserInputRequest.java
More file actions
96 lines (83 loc) · 2.5 KB
/
UserInputRequest.java
File metadata and controls
96 lines (83 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------------------------------------------*/
package com.github.copilot.sdk.json;
import java.util.Collections;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Request for user input from the agent.
* <p>
* This is sent when the agent uses the ask_user tool to request input from the
* user.
*
* @since 1.0.6
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class UserInputRequest {
@JsonProperty("question")
private String question;
@JsonProperty("choices")
private List<String> choices;
@JsonProperty("allowFreeform")
private Boolean allowFreeform;
/**
* Gets the question to ask the user.
*
* @return the question text
*/
public String getQuestion() {
return question;
}
/**
* Sets the question to ask the user.
*
* @param question
* the question text
* @return this instance for method chaining
*/
public UserInputRequest setQuestion(String question) {
this.question = question;
return this;
}
/**
* Gets the optional choices for multiple choice questions.
*
* @return the list of choices, or {@code null} for freeform input
*/
public List<String> getChoices() {
return choices == null ? null : Collections.unmodifiableList(choices);
}
/**
* Sets the choices for multiple choice questions.
*
* @param choices
* the list of choices
* @return this instance for method chaining
*/
public UserInputRequest setChoices(List<String> choices) {
this.choices = choices;
return this;
}
/**
* Returns whether freeform text input is allowed.
*
* @return {@code true} if freeform input is allowed, {@code null} if not
* specified
*/
public Boolean getAllowFreeform() {
return allowFreeform;
}
/**
* Sets whether freeform text input is allowed.
*
* @param allowFreeform
* {@code true} to allow freeform input
* @return this instance for method chaining
*/
public UserInputRequest setAllowFreeform(Boolean allowFreeform) {
this.allowFreeform = allowFreeform;
return this;
}
}