forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcapabilities.test.ts
More file actions
81 lines (72 loc) · 1.81 KB
/
Copy pathcapabilities.test.ts
File metadata and controls
81 lines (72 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import { describe, it, expect } from "vitest";
import { BuiltInAgent } from "../index";
describe("BuiltInAgent.getCapabilities", () => {
it("should return default inferred capabilities", async () => {
const agent = new BuiltInAgent({
model: "openai/gpt-4o",
});
const capabilities = await agent.getCapabilities();
expect(capabilities).toEqual({
tools: {
supported: true,
clientProvided: true,
},
transport: {
streaming: true,
},
});
});
it("should merge explicit overrides with inferred defaults", async () => {
const agent = new BuiltInAgent({
model: "openai/gpt-4o",
capabilities: {
reasoning: {
supported: true,
streaming: true,
},
identity: {
name: "my-agent",
type: "custom",
},
},
});
const capabilities = await agent.getCapabilities();
expect(capabilities).toEqual({
tools: {
supported: true,
clientProvided: true,
},
transport: {
streaming: true,
},
reasoning: {
supported: true,
streaming: true,
},
identity: {
name: "my-agent",
type: "custom",
},
});
});
it("should allow overrides to replace entire categories", async () => {
const agent = new BuiltInAgent({
model: "openai/gpt-4o",
capabilities: {
tools: {
supported: true,
clientProvided: true,
parallelCalls: true,
},
},
});
const capabilities = await agent.getCapabilities();
expect(capabilities.tools).toEqual({
supported: true,
clientProvided: true,
parallelCalls: true,
});
// transport still inferred
expect(capabilities.transport).toEqual({ streaming: true });
});
});