File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 55import com .github .copilot .sdk .json .*;
66import java .util .concurrent .CompletableFuture ;
77
8+ import static java .lang .System .out ;
9+
810class CopilotSDK {
911 public static void main (String [] args ) throws Exception {
1012 // Create and start client
@@ -17,16 +19,16 @@ public static void main(String[] args) throws Exception {
1719
1820 // Handle assistant message events
1921 session .on (AssistantMessageEvent .class , msg -> {
20- System . out .println (msg .getData ().getContent ());
22+ out .println (msg .getData ().content ());
2123 });
2224
2325 // Handle session usage info events
2426 session .on (SessionUsageInfoEvent .class , usage -> {
2527 var data = usage .getData ();
26- System . out .println ("\n --- Usage Metrics ---" );
27- System . out .println ("Current tokens: " + (int ) data .getCurrentTokens ());
28- System . out .println ("Token limit: " + (int ) data .getTokenLimit ());
29- System . out .println ("Messages count: " + (int ) data .getMessagesLength ());
28+ out .println ("\n --- Usage Metrics ---" );
29+ out .println ("Current tokens: " + (int ) data .currentTokens ());
30+ out .println ("Token limit: " + (int ) data .tokenLimit ());
31+ out .println ("Messages count: " + (int ) data .messagesLength ());
3032 });
3133
3234 // Send a message
You can’t perform that action at this time.
0 commit comments