mirror of
https://github.com/github/awesome-copilot.git
synced 2026-04-12 11:15:56 +00:00
fix: Java cookbook recipes to compile with copilot-sdk-java 0.2.1-java.1
Fix compilation errors and documentation inaccuracies in Java cookbook recipes against the actual SDK API: - MultipleSessions: Replace non-existent destroy() with close() - AccessibilityReport: Replace non-existent McpServerConfig class with Map<String, Object> (the actual type accepted by setMcpServers) - error-handling.md: Replace non-existent session.addTool(), ToolDefinition.builder(), and ToolResultObject with actual SDK APIs (ToolDefinition.create(), SessionConfig.setTools(), CompletableFuture<Object> return type) All 7 recipes now compile successfully with jbang build. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -48,9 +48,9 @@ public class MultipleSessions {
|
||||
session3.sendAndWait(new MessageOptions().setPrompt("How do I initialize a module?")).get();
|
||||
|
||||
// Clean up all sessions
|
||||
session1.destroy().get();
|
||||
session2.destroy().get();
|
||||
session3.destroy().get();
|
||||
session1.close();
|
||||
session2.close();
|
||||
session3.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -136,7 +136,7 @@ var session = client.createSession(new SessionConfig()
|
||||
|
||||
session.sendAndWait(new MessageOptions().setPrompt("Hello!")).get();
|
||||
|
||||
session.destroy().get();
|
||||
session.close();
|
||||
client.stop().get();
|
||||
executor.shutdown();
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user