@eventcatalog/core 2.35.7 → 2.35.8
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-O7CEYSZC.js → chunk-3LCAKJ2U.js} +1 -1
- package/dist/{chunk-ZEIS5QXO.js → chunk-AS3INH2X.js} +1 -1
- package/dist/{chunk-GRFWCJAM.js → chunk-RAHESCX4.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 +3 -3
- package/eventcatalog/src/enterprise/eventcatalog-chat/EventCatalogVectorStore.ts +15 -1
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/windows/ChatWindow.client.tsx +1 -1
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/windows/ChatWindow.server.tsx +6 -2
- package/eventcatalog/src/enterprise/eventcatalog-chat/pages/api/ai/chat.ts +0 -2
- package/eventcatalog/src/enterprise/eventcatalog-chat/pages/chat/index.astro +13 -1
- package/eventcatalog/src/utils/generators/index.ts +10 -0
- package/package.json +3 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-AS3INH2X.js";
|
|
4
|
+
import "../chunk-RAHESCX4.js";
|
|
5
|
+
import "../chunk-3LCAKJ2U.js";
|
|
6
6
|
import "../chunk-E7TXTI7G.js";
|
|
7
7
|
export {
|
|
8
8
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
package/dist/eventcatalog.js
CHANGED
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
} from "./chunk-DCLTVJDP.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-AS3INH2X.js";
|
|
10
|
+
import "./chunk-RAHESCX4.js";
|
|
11
11
|
import {
|
|
12
12
|
catalogToAstro,
|
|
13
13
|
checkAndConvertMdToMdx
|
|
14
14
|
} from "./chunk-5ZG43YD2.js";
|
|
15
15
|
import {
|
|
16
16
|
VERSION
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-3LCAKJ2U.js";
|
|
18
18
|
import {
|
|
19
19
|
isBackstagePluginEnabled,
|
|
20
20
|
isEventCatalogScaleEnabled,
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { HuggingFaceTransformersEmbeddings } from '@langchain/community/embeddings/huggingface_transformers';
|
|
2
2
|
import { MemoryVectorStore } from 'langchain/vectorstores/memory';
|
|
3
3
|
import { Document as LangChainDocument } from 'langchain/document';
|
|
4
|
+
import { OpenAIEmbeddings } from '@langchain/openai';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
import { getConfigurationForGivenGenerator } from '@utils/generators';
|
|
7
|
+
|
|
8
|
+
const aiGeneratorConfiguration = getConfigurationForGivenGenerator('@eventcatalog/generator-ai');
|
|
9
|
+
const embedding = aiGeneratorConfiguration?.embedding || {};
|
|
6
10
|
|
|
7
11
|
export interface Resource {
|
|
8
12
|
id: string;
|
|
@@ -21,6 +25,16 @@ export class EventCatalogVectorStore {
|
|
|
21
25
|
|
|
22
26
|
// Static async factory method
|
|
23
27
|
public static async create(documents: LangChainDocument[], embeddings: number[][]): Promise<EventCatalogVectorStore> {
|
|
28
|
+
let embeddingsInstance: any;
|
|
29
|
+
|
|
30
|
+
if (embedding.provider === 'openai') {
|
|
31
|
+
const model = embedding.model || 'text-embedding-3-large';
|
|
32
|
+
embeddingsInstance = new OpenAIEmbeddings({ model });
|
|
33
|
+
} else {
|
|
34
|
+
const model = embedding.model || 'all-MiniLM-L6-v2';
|
|
35
|
+
embeddingsInstance = new HuggingFaceTransformersEmbeddings({ model });
|
|
36
|
+
}
|
|
37
|
+
|
|
24
38
|
const vectorStore = new MemoryVectorStore(embeddingsInstance);
|
|
25
39
|
await vectorStore.addVectors(embeddings, documents);
|
|
26
40
|
return new EventCatalogVectorStore(vectorStore);
|
package/eventcatalog/src/enterprise/eventcatalog-chat/components/windows/ChatWindow.client.tsx
CHANGED
|
@@ -511,7 +511,7 @@ const ChatWindow = ({
|
|
|
511
511
|
<div className="max-w-[900px] mx-auto flex justify-between">
|
|
512
512
|
{/* show what model is loaded */}
|
|
513
513
|
<p className="text-xs text-gray-400 mt-2">Model: {model}</p>
|
|
514
|
-
<p className="text-xs text-gray-500 mt-2">EventCatalog
|
|
514
|
+
<p className="text-xs text-gray-500 mt-2">EventCatalog Chat can make mistakes. Check important info.</p>
|
|
515
515
|
</div>
|
|
516
516
|
</div>
|
|
517
517
|
</div>
|
package/eventcatalog/src/enterprise/eventcatalog-chat/components/windows/ChatWindow.server.tsx
CHANGED
|
@@ -20,6 +20,7 @@ interface Resource {
|
|
|
20
20
|
|
|
21
21
|
interface ChatWindowProps {
|
|
22
22
|
model?: string;
|
|
23
|
+
embeddingModel?: string;
|
|
23
24
|
max_tokens?: number;
|
|
24
25
|
similarityResults?: number;
|
|
25
26
|
resources: Resource[];
|
|
@@ -28,6 +29,7 @@ interface ChatWindowProps {
|
|
|
28
29
|
|
|
29
30
|
const ChatWindow = ({
|
|
30
31
|
model = 'o4-mini',
|
|
32
|
+
embeddingModel = 'text-embedding-3-large',
|
|
31
33
|
max_tokens = 4096,
|
|
32
34
|
similarityResults = 50,
|
|
33
35
|
resources: mentionInputResources = [],
|
|
@@ -478,8 +480,10 @@ const ChatWindow = ({
|
|
|
478
480
|
</div>
|
|
479
481
|
<div className="max-w-[900px] mx-auto flex justify-between">
|
|
480
482
|
{/* show what model is loaded */}
|
|
481
|
-
<p className="text-xs text-gray-400 mt-2">
|
|
482
|
-
|
|
483
|
+
<p className="text-xs text-gray-400 mt-2">
|
|
484
|
+
Model: {model}, Embedding Model: {embeddingModel}
|
|
485
|
+
</p>
|
|
486
|
+
<p className="text-xs text-gray-500 mt-2">EventCatalog Chat can make mistakes. Check important info.</p>
|
|
483
487
|
</div>
|
|
484
488
|
</div>
|
|
485
489
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { APIContext } from 'astro';
|
|
2
2
|
import { askQuestion } from '@enterprise/eventcatalog-chat/utils/ai';
|
|
3
|
-
import config from '@config';
|
|
4
|
-
const output = config.output || 'static';
|
|
5
3
|
|
|
6
4
|
// Map the Keys to use in the SDK, astro exports as import.meta.env
|
|
7
5
|
process.env.OPENAI_API_KEY = import.meta.env.OPENAI_API_KEY || '';
|
|
@@ -11,10 +11,19 @@ import { getEvents } from '@utils/events';
|
|
|
11
11
|
import { getCommands } from '@utils/commands';
|
|
12
12
|
import { getServices } from '@utils/collections/services';
|
|
13
13
|
import { getQueries } from '@utils/queries';
|
|
14
|
+
import { getConfigurationForGivenGenerator } from '@utils/generators';
|
|
15
|
+
|
|
14
16
|
const isEnabled = config.chat?.enabled || false;
|
|
15
17
|
const chatConfig = config.chat || {};
|
|
16
18
|
const output = config.output || 'static';
|
|
17
19
|
|
|
20
|
+
const aiGeneratorConfig = getConfigurationForGivenGenerator('@eventcatalog/generator-ai');
|
|
21
|
+
let embeddingModel = aiGeneratorConfig?.embedding?.model || 'all-MiniLM-L6-v2';
|
|
22
|
+
|
|
23
|
+
if (aiGeneratorConfig?.embedding?.provider === 'openai') {
|
|
24
|
+
embeddingModel = aiGeneratorConfig?.embedding?.model || 'text-embedding-3-large';
|
|
25
|
+
}
|
|
26
|
+
|
|
18
27
|
const PROJECT_DIR = path.resolve(process.env.PROJECT_DIR || process.cwd());
|
|
19
28
|
const GENERATED_AI_DIR = path.resolve(PROJECT_DIR, 'public/ai');
|
|
20
29
|
|
|
@@ -68,7 +77,10 @@ const generatorConfig = `
|
|
|
68
77
|
<div id="chatContainer" class="w-full">
|
|
69
78
|
<Chat
|
|
70
79
|
client:only="react"
|
|
71
|
-
chatConfig={
|
|
80
|
+
chatConfig={{
|
|
81
|
+
...chatConfig,
|
|
82
|
+
embeddingModel,
|
|
83
|
+
}}
|
|
72
84
|
resources={resources}
|
|
73
85
|
chatPrompts={chatPrompts}
|
|
74
86
|
output={output as 'static' | 'server'}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Should really only be used on the server side
|
|
2
|
+
// If users are using path or fs in the eventcatalog.config.js file, it will break the build (for now)
|
|
3
|
+
|
|
4
|
+
import config from '@config';
|
|
5
|
+
|
|
6
|
+
export const getConfigurationForGivenGenerator = (generator: string) => {
|
|
7
|
+
const generators = config.generators ?? [];
|
|
8
|
+
const generatorConfig = generators.find((g: any) => g[0] === generator);
|
|
9
|
+
return generatorConfig?.[1];
|
|
10
|
+
};
|
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": "2.35.
|
|
9
|
+
"version": "2.35.8",
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@asyncapi/avro-schema-parser": "^3.0.24",
|
|
32
32
|
"@asyncapi/parser": "^3.4.0",
|
|
33
33
|
"@asyncapi/react-component": "^2.4.3",
|
|
34
|
-
"@eventcatalog/generator-ai": "^1.0.
|
|
34
|
+
"@eventcatalog/generator-ai": "^1.0.2",
|
|
35
35
|
"@eventcatalog/sdk": "^2.2.7",
|
|
36
36
|
"@fontsource/inter": "^5.2.5",
|
|
37
37
|
"@headlessui/react": "^2.0.3",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"@huggingface/transformers": "^3.3.3",
|
|
40
40
|
"@iconify-json/logos": "^1.2.4",
|
|
41
41
|
"@langchain/community": "^0.3.32",
|
|
42
|
+
"@langchain/openai": "^0.5.6",
|
|
42
43
|
"@mlc-ai/web-llm": "^0.2.78",
|
|
43
44
|
"@parcel/watcher": "^2.4.1",
|
|
44
45
|
"@radix-ui/react-context-menu": "^2.2.6",
|