forked from github/copilot-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathElicitationContext.java
More file actions
112 lines (97 loc) · 3.07 KB
/
ElicitationContext.java
File metadata and controls
112 lines (97 loc) · 3.07 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------------------------------------------*/
package com.github.copilot.sdk.json;
/**
* Context for an elicitation request received from the server or MCP tools.
*
* @since 1.0.0
*/
public class ElicitationContext {
private String sessionId;
private String message;
private ElicitationSchema requestedSchema;
private String mode;
private String elicitationSource;
private String url;
/**
* Gets the session ID that triggered the elicitation request. @return the
* session ID
*/
public String getSessionId() {
return sessionId;
}
/** Sets the session ID. @param sessionId the session ID @return this */
public ElicitationContext setSessionId(String sessionId) {
this.sessionId = sessionId;
return this;
}
/**
* Gets the message describing what information is needed from the user.
*
* @return the message
*/
public String getMessage() {
return message;
}
/** Sets the message. @param message the message @return this */
public ElicitationContext setMessage(String message) {
this.message = message;
return this;
}
/**
* Gets the JSON Schema describing the form fields to present (form mode only).
*
* @return the schema, or {@code null}
*/
public ElicitationSchema getRequestedSchema() {
return requestedSchema;
}
/** Sets the schema. @param requestedSchema the schema @return this */
public ElicitationContext setRequestedSchema(ElicitationSchema requestedSchema) {
this.requestedSchema = requestedSchema;
return this;
}
/**
* Gets the elicitation mode: {@code "form"} for structured input, {@code "url"}
* for browser redirect.
*
* @return the mode, or {@code null} (defaults to {@code "form"})
*/
public String getMode() {
return mode;
}
/** Sets the mode. @param mode the mode @return this */
public ElicitationContext setMode(String mode) {
this.mode = mode;
return this;
}
/**
* Gets the source that initiated the request (e.g., MCP server name).
*
* @return the elicitation source, or {@code null}
*/
public String getElicitationSource() {
return elicitationSource;
}
/**
* Sets the elicitation source. @param elicitationSource the source @return this
*/
public ElicitationContext setElicitationSource(String elicitationSource) {
this.elicitationSource = elicitationSource;
return this;
}
/**
* Gets the URL to open in the user's browser (url mode only).
*
* @return the URL, or {@code null}
*/
public String getUrl() {
return url;
}
/** Sets the URL. @param url the URL @return this */
public ElicitationContext setUrl(String url) {
this.url = url;
return this;
}
}