Skip to content

Commit 3f5ab04

Browse files
Deploy documentation: snapshot
1 parent 6b081da commit 3f5ab04

302 files changed

Lines changed: 346 additions & 303 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

snapshot/advanced.html

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,50 @@ <h2>Custom Configuration Directory</h2>
319319
.setConfigDir(&quot;/path/to/custom/config&quot;)
320320
).get();
321321
</code></pre>
322-
<p>This is useful when you need to isolate session configuration or use different settings for different environments.</p><hr /></section><section><a id="Permission_Handling"></a>
322+
<p>This is useful when you need to isolate session configuration or use different settings for different environments.</p><hr /></section><section><a id="User_Input_Handling"></a>
323+
<h2>User Input Handling</h2>
324+
<p>Handle user input requests when the AI uses the <code>ask_user</code> tool to gather information from the user.</p>
325+
326+
<pre class="prettyprint"><code class="language-java">var session = client.createSession(
327+
new SessionConfig()
328+
.setOnUserInputRequest((request, invocation) -&gt; {
329+
System.out.println(&quot;Agent asks: &quot; + request.getQuestion());
330+
331+
// Check if choices are provided
332+
if (request.getChoices() != null &amp;&amp; !request.getChoices().isEmpty()) {
333+
System.out.println(&quot;Options: &quot; + request.getChoices());
334+
// Return one of the provided choices
335+
String selectedChoice = request.getChoices().get(0);
336+
return CompletableFuture.completedFuture(
337+
new UserInputResponse()
338+
.setAnswer(selectedChoice)
339+
.setWasFreeform(false)
340+
);
341+
}
342+
343+
// Freeform input
344+
String userAnswer = getUserInput(); // your input method
345+
return CompletableFuture.completedFuture(
346+
new UserInputResponse()
347+
.setAnswer(userAnswer)
348+
.setWasFreeform(true)
349+
);
350+
})
351+
).get();
352+
</code></pre>
353+
<p>The <code>UserInputRequest</code> contains:</p>
354+
<ul>
355+
356+
<li><code>getQuestion()</code> - The question the AI is asking</li>
357+
<li><code>getChoices()</code> - Optional list of choices for the user to select from</li>
358+
</ul>
359+
<p>The <code>UserInputResponse</code> should include:</p>
360+
<ul>
361+
362+
<li><code>setAnswer(String)</code> - The user's answer</li>
363+
<li><code>setWasFreeform(boolean)</code> - <code>true</code> if the answer was freeform text, <code>false</code> if it was from the provided choices</li>
364+
</ul>
365+
<p>See <a href="apidocs/com/github/copilot/sdk/json/UserInputHandler.html">UserInputHandler</a> Javadoc for more details.</p><hr /></section><section><a id="Permission_Handling"></a>
323366
<h2>Permission Handling</h2>
324367
<p>Approve or deny permission requests from the AI.</p>
325368

snapshot/apidocs/allclasses-index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE HTML>
22
<html lang>
33
<head>
4-
<!-- Generated by javadoc (17) on Mon Feb 02 18:11:39 UTC 2026 -->
4+
<!-- Generated by javadoc (17) on Mon Feb 02 18:28:48 UTC 2026 -->
55
<title>All Classes and Interfaces (GitHub Copilot Community SDK :: Java 1.0.7-SNAPSHOT API)</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

snapshot/apidocs/allpackages-index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE HTML>
22
<html lang>
33
<head>
4-
<!-- Generated by javadoc (17) on Mon Feb 02 18:11:39 UTC 2026 -->
4+
<!-- Generated by javadoc (17) on Mon Feb 02 18:28:48 UTC 2026 -->
55
<title>All Packages (GitHub Copilot Community SDK :: Java 1.0.7-SNAPSHOT API)</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

snapshot/apidocs/com/github/copilot/sdk/ConnectionState.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE HTML>
22
<html lang>
33
<head>
4-
<!-- Generated by javadoc (17) on Mon Feb 02 18:11:39 UTC 2026 -->
4+
<!-- Generated by javadoc (17) on Mon Feb 02 18:28:48 UTC 2026 -->
55
<title>ConnectionState (GitHub Copilot Community SDK :: Java 1.0.7-SNAPSHOT API)</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

snapshot/apidocs/com/github/copilot/sdk/CopilotClient.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE HTML>
22
<html lang>
33
<head>
4-
<!-- Generated by javadoc (17) on Mon Feb 02 18:11:39 UTC 2026 -->
4+
<!-- Generated by javadoc (17) on Mon Feb 02 18:28:48 UTC 2026 -->
55
<title>CopilotClient (GitHub Copilot Community SDK :: Java 1.0.7-SNAPSHOT API)</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

snapshot/apidocs/com/github/copilot/sdk/CopilotSession.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE HTML>
22
<html lang>
33
<head>
4-
<!-- Generated by javadoc (17) on Mon Feb 02 18:11:39 UTC 2026 -->
4+
<!-- Generated by javadoc (17) on Mon Feb 02 18:28:48 UTC 2026 -->
55
<title>CopilotSession (GitHub Copilot Community SDK :: Java 1.0.7-SNAPSHOT API)</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

snapshot/apidocs/com/github/copilot/sdk/SdkProtocolVersion.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE HTML>
22
<html lang>
33
<head>
4-
<!-- Generated by javadoc (17) on Mon Feb 02 18:11:39 UTC 2026 -->
4+
<!-- Generated by javadoc (17) on Mon Feb 02 18:28:48 UTC 2026 -->
55
<title>SdkProtocolVersion (GitHub Copilot Community SDK :: Java 1.0.7-SNAPSHOT API)</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

snapshot/apidocs/com/github/copilot/sdk/SystemMessageMode.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE HTML>
22
<html lang>
33
<head>
4-
<!-- Generated by javadoc (17) on Mon Feb 02 18:11:39 UTC 2026 -->
4+
<!-- Generated by javadoc (17) on Mon Feb 02 18:28:48 UTC 2026 -->
55
<title>SystemMessageMode (GitHub Copilot Community SDK :: Java 1.0.7-SNAPSHOT API)</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

snapshot/apidocs/com/github/copilot/sdk/class-use/ConnectionState.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE HTML>
22
<html lang>
33
<head>
4-
<!-- Generated by javadoc (17) on Mon Feb 02 18:11:39 UTC 2026 -->
4+
<!-- Generated by javadoc (17) on Mon Feb 02 18:28:48 UTC 2026 -->
55
<title>Uses of Enum Class com.github.copilot.sdk.ConnectionState (GitHub Copilot Community SDK :: Java 1.0.7-SNAPSHOT API)</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

snapshot/apidocs/com/github/copilot/sdk/class-use/CopilotClient.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE HTML>
22
<html lang>
33
<head>
4-
<!-- Generated by javadoc (17) on Mon Feb 02 18:11:39 UTC 2026 -->
4+
<!-- Generated by javadoc (17) on Mon Feb 02 18:28:48 UTC 2026 -->
55
<title>Uses of Class com.github.copilot.sdk.CopilotClient (GitHub Copilot Community SDK :: Java 1.0.7-SNAPSHOT API)</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

0 commit comments

Comments
 (0)