You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/copilot/how-tos/copilot-sdk/integrations/microsoft-agent-framework.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ The Microsoft Agent Framework is the unified successor to Semantic Kernel and Au
24
24
| A2A protocol | Agent-to-Agent communication standard supported by the framework |
25
25
26
26
> [!NOTE]
27
-
> MAF integration packages are available for .NET and Python. For TypeScriptand Go, use the {% data variables.copilot.copilot_sdk_short %} directly—the standard SDK APIs provide tool calling, streaming, and custom agents.
27
+
> MAF integration packages are available for .NET and Python. For TypeScript, Go, and Java, use the {% data variables.copilot.copilot_sdk_short %} directly—the standard SDK APIs provide tool calling, streaming, and custom agents.
*[Blog: Build AI Agents with GitHub Copilot SDK and Microsoft Agent Framework](https://devblogs.microsoft.com/semantic-kernel/build-ai-agents-with-github-copilot-sdk-and-microsoft-agent-framework/)
Copy file name to clipboardExpand all lines: content/copilot/how-tos/copilot-sdk/sdk-getting-started.md
+182-1Lines changed: 182 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -144,4 +144,185 @@ unsubscribeIdle();
144
144
145
145
## Next steps
146
146
147
-
To continue getting started with {% data variables.copilot.copilot_sdk_short %}, see [Build Your First Copilot-Powered App](https://github.com/github/copilot-sdk/blob/main/docs/getting-started.md#step-4-add-a-custom-tool) in the `github/copilot-sdk` repository.
147
+
### Add a custom tool
148
+
149
+
Give {% data variables.product.prodname_copilot_short %} the ability to call your code by defining a custom tool. Here's a weather lookup tool:
150
+
151
+
```typescript copy
152
+
import { CopilotClient, defineTool } from "@github/copilot-sdk";
153
+
154
+
// Define a tool that Copilot can call
155
+
const getWeather = defineTool("get_weather", {
156
+
description: "Get the current weather for a city",
157
+
parameters: {
158
+
type: "object",
159
+
properties: {
160
+
city: { type: "string", description: "The city name" },
prompt: "What's the weather like in Seattle and Tokyo?",
191
+
});
192
+
193
+
await client.stop();
194
+
process.exit(0);
195
+
```
196
+
197
+
For examples in Python, Go, .NET, and Rust, see [Getting started](https://github.com/github/copilot-sdk/blob/main/docs/getting-started.md#step-4-add-a-custom-tool) in the `github/copilot-sdk` repository. {% data reusables.copilot.copilot-sdk.java-sdk-link %}
198
+
199
+
When you define a tool, you're telling {% data variables.product.prodname_copilot_short %}:
200
+
201
+
1. **What the tool does** (description)
202
+
1. **What parameters it needs** (schema)
203
+
1. **What code to run** (handler)
204
+
205
+
{% data variables.product.prodname_copilot_short %} decides when to call your tool based on the user's question. When it does, the {% data variables.copilot.copilot_sdk_short %} runs your handler function and sends the result back to {% data variables.product.prodname_copilot_short %}, which incorporates it into the response.
206
+
207
+
### Build an interactive assistant
208
+
209
+
Combine everything into an interactive chat assistant:
210
+
211
+
```typescript copy
212
+
import { CopilotClient, defineTool } from "@github/copilot-sdk";
213
+
import * as readline from "readline";
214
+
215
+
const getWeather = defineTool("get_weather", {
216
+
description: "Get the current weather for a city",
217
+
parameters: {
218
+
type: "object",
219
+
properties: {
220
+
city: { type: "string", description: "The city name" },
console.log("Weather Assistant (type 'exit' to quit)");
249
+
console.log(" Try: 'What's the weather in Paris?'\n");
250
+
251
+
const prompt = () => {
252
+
rl.question("You: ", async (input) => {
253
+
if (input.toLowerCase() === "exit") {
254
+
await client.stop();
255
+
rl.close();
256
+
return;
257
+
}
258
+
259
+
process.stdout.write("Assistant: ");
260
+
await session.sendAndWait({ prompt: input });
261
+
console.log("\n");
262
+
prompt();
263
+
});
264
+
};
265
+
266
+
prompt();
267
+
```
268
+
269
+
Run with:
270
+
271
+
```bash copy
272
+
npx tsx weather-assistant.ts
273
+
```
274
+
275
+
For examples in Python, Go, .NET, and Rust, see [Getting started](https://github.com/github/copilot-sdk/blob/main/docs/getting-started.md#step-5-build-an-interactive-assistant) in the `github/copilot-sdk` repository. {% data reusables.copilot.copilot-sdk.java-sdk-link %}
276
+
277
+
### Connect to MCP servers
278
+
279
+
MCP (Model Context Protocol) servers provide pre-built tools. Connect to {% data variables.product.github %}'s MCP server to give {% data variables.product.prodname_copilot_short %} access to repositories, issues, and pull requests:
280
+
281
+
```typescript copy
282
+
const session = await client.createSession({
283
+
mcpServers: {
284
+
github: {
285
+
type: "http",
286
+
url: "https://api.githubcopilot.com/mcp/",
287
+
},
288
+
},
289
+
});
290
+
```
291
+
292
+
For more information, see [AUTOTITLE](/copilot/how-tos/copilot-sdk/use-copilot-sdk/mcp-servers).
293
+
294
+
### Create custom agents
295
+
296
+
Define specialized AI personas for specific tasks:
297
+
298
+
```typescript copy
299
+
const session = await client.createSession({
300
+
customAgents: [{
301
+
name: "pr-reviewer",
302
+
displayName: "PR Reviewer",
303
+
description: "Reviews pull requests for best practices",
304
+
prompt: "You are an expert code reviewer. Focus on security, performance, and maintainability.",
305
+
}],
306
+
});
307
+
```
308
+
309
+
For more information, see [AUTOTITLE](/copilot/how-tos/copilot-sdk/use-copilot-sdk/custom-agents).
310
+
311
+
### Customize the system message
312
+
313
+
Control the AI's behavior and personality by appending instructions:
314
+
315
+
```typescript copy
316
+
const session = await client.createSession({
317
+
systemMessage: {
318
+
content: "You are a helpful assistant for our engineering team. Always be concise.",
* [Connecting to an external CLI server](https://github.com/github/copilot-sdk/blob/main/docs/getting-started.md#connecting-to-an-external-cli-server) in the `github/copilot-sdk` repository
328
+
* [Telemetry and observability](https://github.com/github/copilot-sdk/blob/main/docs/getting-started.md#telemetry-and-observability) in the `github/copilot-sdk` repository
0 commit comments