@constructive-io/graphql-codegen 4.47.0 → 4.47.1
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.
|
@@ -17,8 +17,6 @@
|
|
|
17
17
|
* Any changes here will affect all generated CLI embedder modules.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import OllamaClient from '@agentic-kit/ollama';
|
|
21
|
-
|
|
22
20
|
// ─── Types ───────────────────────────────────────────────────────────────────
|
|
23
21
|
|
|
24
22
|
export type EmbedderFunction = (text: string) => Promise<number[]>;
|
|
@@ -38,8 +36,18 @@ function createOllamaEmbedder(
|
|
|
38
36
|
baseUrl: string = 'http://localhost:11434',
|
|
39
37
|
model: string = 'nomic-embed-text'
|
|
40
38
|
): EmbedderFunction {
|
|
41
|
-
|
|
39
|
+
let clientP: Promise<{ generateEmbedding: (text: string, model: string) => Promise<{ embedding: number[] }> }> | undefined;
|
|
42
40
|
return async (text: string): Promise<number[]> => {
|
|
41
|
+
if (!clientP) {
|
|
42
|
+
clientP = import('@agentic-kit/ollama')
|
|
43
|
+
.then((m) => new m.default(baseUrl))
|
|
44
|
+
.catch(() => {
|
|
45
|
+
throw new Error(
|
|
46
|
+
'The ollama embedder requires @agentic-kit/ollama. Install it: npm i @agentic-kit/ollama'
|
|
47
|
+
);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const client = await clientP;
|
|
43
51
|
const result = await client.generateEmbedding(text, model);
|
|
44
52
|
return result.embedding;
|
|
45
53
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructive-io/graphql-codegen",
|
|
3
|
-
"version": "4.47.
|
|
3
|
+
"version": "4.47.1",
|
|
4
4
|
"description": "GraphQL SDK generator for Constructive databases with React Query hooks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"graphql",
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"tsx": "^4.21.0",
|
|
101
101
|
"typescript": "^5.9.3"
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "3fba816f0989892fa81c88cf331795eef7a4da0b"
|
|
104
104
|
}
|