GitHub Blog
1. Using the GitHub Copilot SDK for Java
本文介绍了新的 GitHub Copilot SDK for Java,使企业 Java 开发人员能够以与框架无关的方式集成 AI,并支持 BYOK,对现代 Java 开发具有高度相关性。 (score: 0.92)
The GitHub Copilot SDK for Java offers a framework-agnostic way to integrate AI into enterprise Java applications. It supports BYOK, allowing use with various model providers like OpenAI, Azure, or Anthropic without a Copilot subscription. The SDK provides idiomatic Java APIs including annotations, lambdas, and virtual threads. This article demonstrates a sample Jakarta EE 11 application, showing how to define tools with @CopilotTool, customize system messages, handle agentic loops, and integrate with Jakarta Concurrency for container-managed virtual threads.
- Framework-agnostic SDK for integrating AI into Java enterprise apps.
- Supports BYOK to work with any model provider like OpenAI, Azure, or Anthropic.
- Provides idiomatic Java APIs: CompletableFuture, annotations, lambdas, and virtual threads.
- Includes @CopilotTool annotation for declaring tools and ToolDefinition for inline lambda tools.
- Features customizable system messages and fine-grained tool access control via ToolSet.
- Agentic loop handled by session.sendAndWait(), with real-time event streaming via session.on().
- Composes naturally with Jakarta EE, using container-managed virtual threads for context propagation.