forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwildcard-tool-render.component.ts
More file actions
35 lines (33 loc) · 976 Bytes
/
Copy pathwildcard-tool-render.component.ts
File metadata and controls
35 lines (33 loc) · 976 Bytes
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
import { Component, input, Input } from "@angular/core";
import { CommonModule } from "@angular/common";
import { AngularToolCall, ToolRenderer } from "@copilotkit/angular";
@Component({
selector: "wildcard-tool-render",
standalone: true,
imports: [CommonModule],
template: `
<div
style="
padding: 12px;
margin: 8px 0;
background-color: #f5f5f5;
border-radius: 8px;
border: 1px solid #ddd;
"
>
<div style="font-weight: bold; margin-bottom: 4px">🔧 Tool Execution</div>
<div style="font-size: 14px; color: #666">
<pre>{{ argsJson }}</pre>
</div>
<div style="margin-top: 8px; color: #333">
Output: {{ toolCall().result }}
</div>
</div>
`,
})
export class WildcardToolRenderComponent implements ToolRenderer {
readonly toolCall = input.required<AngularToolCall<any>>();
get argsJson() {
return JSON.stringify(this.toolCall().args, null, 2);
}
}