@eventcatalog/core 3.1.0 → 3.2.0
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.
- package/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/{chunk-ESUL7UE6.js → chunk-AA47DJ43.js} +1 -1
- package/dist/{chunk-KBO4IL2D.js → chunk-GGRXP5WM.js} +1 -1
- package/dist/{chunk-2WGZFERB.js → chunk-L3QRQT7U.js} +1 -1
- package/dist/{chunk-URR33SNK.js → chunk-RWYEP5SD.js} +1 -1
- package/dist/{chunk-I3CW5KQI.js → chunk-VPQCMMRM.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +5 -5
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/src/components/ChatPanel/ChatPanel.tsx +488 -231
- package/eventcatalog/src/components/ChatPanel/ChatPanelButton.tsx +2 -2
- package/eventcatalog/src/enterprise/ai/chat-api.ts +24 -3
- package/package.json +7 -6
|
@@ -9,11 +9,11 @@ const ChatPanelButton = () => {
|
|
|
9
9
|
<>
|
|
10
10
|
<button
|
|
11
11
|
onClick={() => setIsOpen(true)}
|
|
12
|
-
className="flex items-center gap-1.5 px-4 py-1.5 rounded-md bg-
|
|
12
|
+
className="flex items-center gap-1.5 px-4 py-1.5 rounded-md bg-[rgb(var(--ec-card-bg))] hover:bg-[rgb(var(--ec-content-hover))] ring-1 ring-inset ring-[rgb(var(--ec-page-border))] shadow-sm transition-colors text-sm ml-[-1px]"
|
|
13
13
|
aria-label="Open AI Assistant"
|
|
14
14
|
>
|
|
15
15
|
<BookOpen size={14} className="text-[rgb(var(--ec-accent))]" />
|
|
16
|
-
<span className="font-light text-
|
|
16
|
+
<span className="font-light text-[rgb(var(--ec-page-text-muted))]">Ask</span>
|
|
17
17
|
</button>
|
|
18
18
|
|
|
19
19
|
<ChatPanel isOpen={isOpen} onClose={() => setIsOpen(false)} />
|
|
@@ -28,7 +28,10 @@ try {
|
|
|
28
28
|
model = await providerConfiguration.default();
|
|
29
29
|
modelConfiguration = providerConfiguration.configuration || defaultConfiguration;
|
|
30
30
|
hasChatConfiguration = true;
|
|
31
|
-
|
|
31
|
+
|
|
32
|
+
if (isEventCatalogScaleEnabled()) {
|
|
33
|
+
extendedTools = providerConfiguration.tools || {};
|
|
34
|
+
}
|
|
32
35
|
} catch (error) {
|
|
33
36
|
console.error('[Chat] Error loading chat configuration', error);
|
|
34
37
|
hasChatConfiguration = false;
|
|
@@ -111,12 +114,14 @@ When responding:
|
|
|
111
114
|
5. Don't provide code examples unless specifically requested.
|
|
112
115
|
6. When you refer to a resource in EventCatalog, try and create a link to the resource in the response
|
|
113
116
|
- Example, if you return a message in the text, rather than than just the id or version you should return a markdown link to the resource e.g [MyEvent - 1.0.0](/docs/events/MyEvent/1.0.0)
|
|
114
|
-
- NEVER
|
|
117
|
+
- CRITICAL: NEVER use "latest" in any URL or link. Always use the actual semantic version number (e.g., 1.0.0, 2.1.3). The word "latest" is not a valid version and will result in broken links.
|
|
115
118
|
- The link options are:
|
|
116
119
|
- If you want to get the documentation for a resource use the /docs/ prefix (e.g /docs/{collection}/{id}/{version})
|
|
117
120
|
- If you want to let the user know they can visualize a resource use the /visualiser/ prefix (e.g /visualiser/{collection}/{id}/{version})
|
|
118
121
|
- If you want to let the user know they can see the architecture of a resource use the /architecture/ prefix (e.g /architecture/{collection}/{id}/{version})
|
|
122
|
+
- If you don't know the version, use the getResource tool to fetch the resource and get the actual version number before creating the link.
|
|
119
123
|
7. When you return a schema, use code blocks to render the schema to the user too, for example if the schema is in JSON format use \`\`\`json and if the schema is in YAML format use \`\`\`yaml
|
|
124
|
+
8. IMPORTANT: After answering each question, ALWAYS use the suggestFollowUpQuestions tool to suggest 2-3 relevant follow-up questions the user might want to ask next. These should be contextual to the conversation and help the user explore related topics.
|
|
120
125
|
|
|
121
126
|
If you have additional context, use it to answer the question.`;
|
|
122
127
|
|
|
@@ -171,7 +176,7 @@ export const POST = async ({ request }: APIContext<{ question: string; messages:
|
|
|
171
176
|
const result = await streamText({
|
|
172
177
|
model,
|
|
173
178
|
system: getBaseSystemPrompt(referrer ?? ''),
|
|
174
|
-
messages: convertToModelMessages(messages)
|
|
179
|
+
messages: await convertToModelMessages(messages),
|
|
175
180
|
temperature: modelConfiguration?.temperature ?? 0.7,
|
|
176
181
|
stopWhen: stepCountIs(5),
|
|
177
182
|
// maxTokens: 4000, // Increased to handle large tool results
|
|
@@ -320,6 +325,22 @@ export const POST = async ({ request }: APIContext<{ question: string; messages:
|
|
|
320
325
|
return [];
|
|
321
326
|
},
|
|
322
327
|
}),
|
|
328
|
+
suggestFollowUpQuestions: tool({
|
|
329
|
+
description:
|
|
330
|
+
'Use this tool after answering a question to suggest 2-3 relevant follow-up questions the user might want to ask. These will be displayed as clickable suggestions.',
|
|
331
|
+
inputSchema: z.object({
|
|
332
|
+
questions: z
|
|
333
|
+
.array(z.string())
|
|
334
|
+
.min(1)
|
|
335
|
+
.max(3)
|
|
336
|
+
.describe('Array of 2-3 follow-up questions relevant to the conversation'),
|
|
337
|
+
}),
|
|
338
|
+
execute: async ({ questions }) => {
|
|
339
|
+
// This tool doesn't need to do anything - it just returns the questions
|
|
340
|
+
// which will be captured by the UI
|
|
341
|
+
return { suggestions: questions };
|
|
342
|
+
},
|
|
343
|
+
}),
|
|
323
344
|
...extendedTools,
|
|
324
345
|
},
|
|
325
346
|
});
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"url": "https://github.com/event-catalog/eventcatalog.git"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
|
-
"version": "3.
|
|
9
|
+
"version": "3.2.0",
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"dist/"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@ai-sdk/react": "^
|
|
23
|
+
"@ai-sdk/react": "^3.0.17",
|
|
24
24
|
"@astrojs/markdown-remark": "^6.3.10",
|
|
25
25
|
"@astrojs/mdx": "^4.3.13",
|
|
26
26
|
"@astrojs/node": "^9.5.1",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"@tanstack/react-query": "^5.74.3",
|
|
54
54
|
"@tanstack/react-table": "^8.17.3",
|
|
55
55
|
"@xyflow/react": "^12.3.6",
|
|
56
|
-
"ai": "^
|
|
57
|
-
"astro": "^5.16.
|
|
56
|
+
"ai": "^6.0.17",
|
|
57
|
+
"astro": "^5.16.7",
|
|
58
58
|
"astro-compress": "^2.3.8",
|
|
59
59
|
"astro-expressive-code": "^0.41.3",
|
|
60
60
|
"astro-seo": "^0.8.4",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"rehype-slug": "^6.0.0",
|
|
95
95
|
"remark-comment": "^1.0.0",
|
|
96
96
|
"remark-directive": "^3.0.0",
|
|
97
|
-
"remark-gfm": "^
|
|
97
|
+
"remark-gfm": "^4.0.1",
|
|
98
98
|
"rimraf": "^5.0.7",
|
|
99
99
|
"semver": "7.6.3",
|
|
100
100
|
"shelljs": "^0.9.0",
|
|
@@ -103,7 +103,8 @@
|
|
|
103
103
|
"typescript": "^5.4.5",
|
|
104
104
|
"unist-util-visit": "^5.0.0",
|
|
105
105
|
"update-notifier": "^7.3.1",
|
|
106
|
-
"uuid": "^10.0.0"
|
|
106
|
+
"uuid": "^10.0.0",
|
|
107
|
+
"zod": "^3.25.0"
|
|
107
108
|
},
|
|
108
109
|
"devDependencies": {
|
|
109
110
|
"@astrojs/check": "^0.9.6",
|