All Posts
News bits
GitHub Copilot SDKがテクニカルプレビューとして公開
GitHub Copilot SDKがテクニカルプレビューとして公開
GitHub Copilot CLIにプログラムからアクセスするためのSDK「Copilot SDK」がテクニカルプレビューとして公開された。
Node.js/TypeScript (@github/copilot-cli-sdk)、Python (copilot)、Go、.NETの4つの言語向けに提供される。
主な特徴:
- マルチターン会話: セッション履歴を維持したコンテキスト認識型の対話が可能。
- ツール実行: モデルが会話中に呼び出せるカスタムツールを定義可能。
- ライフサイクル管理: クライアントとセッションのライフサイクルをプログラムで制御可能。
開発者はこれらのSDKを使用して、Copilotの機能を独自のアプリケーションやワークフローに統合できる。
import { CopilotClient } from "@github/copilot-sdk";
// Create and start client
const client = new CopilotClient();
await client.start();
// Create a session
const session = await client.createSession({
model: "gpt-5",
});
// Wait for response using session.idle event
const done = new Promise<void>((resolve) => {
session.on((event) => {
if (event.type === "assistant.message") {
console.log(event.data.content);
} else if (event.type === "session.idle") {
resolve();
}
});
});
// Send a message and wait for completion
await session.send({ prompt: "What is 2+2?" });
await done;
// Clean up
await session.destroy();
await client.stop();出展:Copilot SDK in technical preview - GitHub Changelog, Copilot SDK for Node.js/TypeScript
著者について
Hi there. I'm hrdtbs, a frontend expert and technical consultant. I started my career in the creative industry over 13 years ago, learning on the job as a 3DCG modeler and game engineer in the indie scene.
In 2015 I began working as a freelance web designer and engineer. I handled everything from design and development to operation and advertising, delivering comprehensive solutions for various clients.
In 2016 I joined Wemotion as CTO, where I built the engineering team from the ground up and led the development of core web and mobile applications for three years.
In 2019 I joined matsuri technologies as a Frontend Expert, and in 2020 I also began serving as a technical manager supporting streamers and content creators.
I'm so grateful to be working in this field, doing something that brings me so much joy. Thanks for stopping by.