@intelliweave/embedded 2.0.72-beta.8 → 2.1.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,128 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <title>IntelliWeave – Subagents Test</title>
7
- </head>
8
- <body>
9
-
10
- <!-- Code -->
11
- <script>
12
- window.intelliweave = {
13
-
14
- // API key
15
- apiKey: '80d31824-ac2a-491d-8eec-b23126dea69c', // <-- Anthropic - Claude Haiku 4.5
16
-
17
- // Enable verbose logging
18
- debug: true,
19
-
20
- // Enable fullscreen layout
21
- layout: 'fullscreen',
22
-
23
- // Introduction details, controls the user's first interaction experience
24
- introductionMessage: 'Welcome to the <b>Subagent Test</b>.',
25
- introductionSuggestions: [
26
- 'Please take me to my profile page.',
27
- 'What is my user ID?',
28
- ],
29
-
30
- }
31
-
32
- </script>
33
- <script src="../dist/script-tag/script-tag.js" type="module"></script>
34
- <script>
35
-
36
- // Override for testing the subagents
37
- window.addEventListener('load', () => {
38
-
39
- // Remove existing knowledge
40
- let ai = window.intelliweave.embed.ai
41
- ai.knowledgeBase.reset()
42
-
43
- // Add some new subagents
44
- // Create a subagent which knows about page routes
45
- const IW_TESTER_ANTHROPIC_KEY = 'a006b8a0-943a-403a-a405-f1137f9f0729'
46
- ai.subAgents.register({
47
- id: 'page-changer',
48
- apiKey: IW_TESTER_ANTHROPIC_KEY,
49
- clearExistingKnowledge: true,
50
- usageInstructions: 'Use this tool to ask the page changer subagent questions about pages and to change the current page.',
51
- knowledge: () => [
52
-
53
- /** Available pages */
54
- {
55
- type: 'info',
56
- isContext: true,
57
- name: 'Page: Home',
58
- content: 'Page URL: /home\nDescription: The homepage'
59
- },
60
- {
61
- type: 'info',
62
- isContext: true,
63
- name: 'Page: About',
64
- content: 'Page URL: /about\nDescription: The about page'
65
- },
66
- {
67
- type: 'info',
68
- isContext: true,
69
- name: 'Page: Contact',
70
- content: 'Page URL: /contact\nDescription: The contact page'
71
- },
72
- {
73
- type: 'info',
74
- isContext: true,
75
- name: 'Page: Profile',
76
- content: 'Page URL: /profile?id=xxx\nDescription: The profile page for a specific user. Replace xxx with the user ID.',
77
- },
78
-
79
- /** Page changer */
80
- {
81
- type: 'action',
82
- isContext: true,
83
- name: 'Change Page',
84
- content: 'Use this tool to change the current page route.',
85
- parameters: [
86
- { type: 'string', name: 'route', description: 'The pathname/route of the page to change to' }
87
- ],
88
- action: async (input, _ai) => {
89
- console.log('CHANGED ROUTE: ', input.route)
90
- alert(`Page changed to: ${input.route}`)
91
- return `Page changed to ${input.route}`
92
- },
93
- },
94
-
95
- ]
96
- })
97
-
98
- // Create a subagent which knows about the current user
99
- let didAskForUserID = false
100
- let userID = "1224"
101
- ai.subAgents.register({
102
- id: 'user-info',
103
- apiKey: IW_TESTER_ANTHROPIC_KEY,
104
- clearExistingKnowledge: true,
105
- usageInstructions: 'Use this tool to ask the user info subagent questions about the current user, including IDs.',
106
- knowledge: () => [
107
-
108
- /** User info */
109
- {
110
- type: 'action',
111
- isContext: true,
112
- name: 'Get User ID',
113
- content: 'Use this tool to get the current user ID.',
114
- action: async (input, _ai) => {
115
- didAskForUserID = true
116
- return `The current user ID is "${userID}"`
117
- },
118
- },
119
-
120
- ]
121
- })
122
-
123
- })
124
-
125
- </script>
126
-
127
- </body>
128
- </html>