@pikku/addon-ollama 0.1.0 → 0.1.2
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/.pikku/addon/pikku-addon-types.gen.ts +31 -4
- package/.pikku/addon/pikku-package.gen.ts +3 -1
- package/.pikku/agent/pikku-agent-map.gen.d.ts +2 -14
- package/.pikku/agent/pikku-agent-types.gen.ts +13 -7
- package/.pikku/channel/pikku-channel-types.gen.ts +177 -0
- package/.pikku/console/pikku-addon-meta.gen.json +58 -0
- package/.pikku/console/pikku-node-types.gen.ts +1 -1
- package/.pikku/function/pikku-function-types.gen.ts +209 -103
- package/.pikku/function/pikku-functions-meta-verbose.gen.json +56 -44
- package/.pikku/function/pikku-functions-meta.gen.json +42 -38
- package/.pikku/function/pikku-functions-meta.gen.ts +1 -1
- package/.pikku/function/pikku-functions.gen.ts +2 -2
- package/.pikku/http/pikku-http-types.gen.ts +147 -0
- package/.pikku/mcp/pikku-mcp-types.gen.ts +183 -0
- package/.pikku/pikku-bootstrap.gen.ts +2 -9
- package/.pikku/pikku-meta-service.gen.ts +10 -0
- package/.pikku/pikku-services.gen.ts +14 -2
- package/.pikku/pikku-types.gen.ts +1 -1
- package/.pikku/queue/pikku-queue-types.gen.ts +27 -0
- package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +81 -62
- package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +84 -65
- package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +6 -0
- package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +6 -0
- package/.pikku/scheduler/pikku-scheduler-types.gen.ts +25 -0
- package/.pikku/schemas/register.gen.ts +17 -17
- package/.pikku/secrets/pikku-secret-types.gen.ts +1 -1
- package/.pikku/secrets/pikku-secrets.gen.ts +1 -1
- package/.pikku/trigger/pikku-trigger-types.gen.ts +1 -1
- package/.pikku/variables/pikku-variable-types.gen.ts +1 -1
- package/.pikku/variables/pikku-variables-meta.gen.json +1 -1
- package/.pikku/variables/pikku-variables.gen.ts +1 -1
- package/.pikku/workflow/pikku-workflow-map.gen.d.ts +9 -5
- package/.pikku/workflow/pikku-workflow-types.gen.ts +66 -57
- package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +1 -1
- package/.pikku/workflow/pikku-workflow-wirings.gen.ts +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +19 -3
- package/dist/.pikku/addon/pikku-addon-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.js +26 -3
- package/dist/.pikku/addon/pikku-addon-types.gen.js.map +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.ts +31 -4
- package/dist/.pikku/addon/pikku-package.gen.js +2 -1
- package/dist/.pikku/addon/pikku-package.gen.js.map +1 -1
- package/dist/.pikku/addon/pikku-package.gen.ts +3 -1
- package/dist/.pikku/agent/pikku-agent-map.gen.d.ts +2 -14
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +6 -6
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts.map +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.js.map +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.ts +13 -7
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +112 -0
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts.map +1 -0
- package/dist/.pikku/channel/pikku-channel-types.gen.js +60 -0
- package/dist/.pikku/channel/pikku-channel-types.gen.js.map +1 -0
- package/dist/.pikku/channel/pikku-channel-types.gen.ts +177 -0
- package/dist/.pikku/console/pikku-addon-meta.gen.json +58 -0
- package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
- package/dist/.pikku/console/pikku-node-types.gen.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +97 -84
- package/dist/.pikku/function/pikku-function-types.gen.d.ts.map +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.js +96 -60
- package/dist/.pikku/function/pikku-function-types.gen.js.map +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.ts +209 -103
- package/dist/.pikku/function/pikku-functions-meta-verbose.gen.json +56 -44
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +42 -38
- package/dist/.pikku/function/pikku-functions-meta.gen.ts +1 -1
- package/dist/.pikku/function/pikku-functions.gen.js +2 -2
- package/dist/.pikku/function/pikku-functions.gen.js.map +1 -1
- package/dist/.pikku/function/pikku-functions.gen.ts +2 -2
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +120 -0
- package/dist/.pikku/http/pikku-http-types.gen.d.ts.map +1 -0
- package/dist/.pikku/http/pikku-http-types.gen.js +72 -0
- package/dist/.pikku/http/pikku-http-types.gen.js.map +1 -0
- package/dist/.pikku/http/pikku-http-types.gen.ts +147 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +131 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts.map +1 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +38 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js.map +1 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.ts +183 -0
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +4 -2
- package/dist/.pikku/pikku-bootstrap.gen.d.ts.map +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +2 -10
- package/dist/.pikku/pikku-bootstrap.gen.js.map +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.ts +2 -9
- package/dist/.pikku/pikku-meta-service.gen.d.ts +8 -0
- package/dist/.pikku/pikku-meta-service.gen.d.ts.map +1 -0
- package/dist/.pikku/pikku-meta-service.gen.js +10 -0
- package/dist/.pikku/pikku-meta-service.gen.js.map +1 -0
- package/dist/.pikku/pikku-meta-service.gen.ts +10 -0
- package/dist/.pikku/pikku-services.gen.d.ts +12 -2
- package/dist/.pikku/pikku-services.gen.d.ts.map +1 -1
- package/dist/.pikku/pikku-services.gen.js +11 -0
- package/dist/.pikku/pikku-services.gen.js.map +1 -1
- package/dist/.pikku/pikku-services.gen.ts +14 -2
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -1
- package/dist/.pikku/pikku-types.gen.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +24 -0
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts.map +1 -0
- package/dist/.pikku/queue/pikku-queue-types.gen.js +17 -0
- package/dist/.pikku/queue/pikku-queue-types.gen.js.map +1 -0
- package/dist/.pikku/queue/pikku-queue-types.gen.ts +27 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +81 -62
- package/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +84 -65
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts +2 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts.map +1 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +7 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js.map +1 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +6 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +6 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +22 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts.map +1 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +17 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js.map +1 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.ts +25 -0
- package/dist/.pikku/schemas/register.gen.js +11 -11
- package/dist/.pikku/schemas/register.gen.js.map +1 -1
- package/dist/.pikku/schemas/register.gen.ts +17 -17
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.ts +1 -1
- package/dist/.pikku/variables/pikku-variables-meta.gen.json +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-map.gen.d.ts +9 -5
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +36 -27
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts.map +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +5 -18
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js.map +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.ts +66 -57
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.ts +1 -1
- package/dist/src/functions/embeddings/embed-many.function.d.ts +3 -0
- package/dist/src/functions/embeddings/embed-many.function.d.ts.map +1 -1
- package/dist/src/functions/embeddings/embed-many.function.js +1 -1
- package/dist/src/functions/embeddings/embed-many.function.js.map +1 -1
- package/dist/src/functions/embeddings/embed.function.d.ts +3 -0
- package/dist/src/functions/embeddings/embed.function.d.ts.map +1 -1
- package/dist/src/functions/embeddings/embed.function.js +1 -1
- package/dist/src/functions/embeddings/embed.function.js.map +1 -1
- package/dist/src/functions/text/generate-object.function.d.ts +17 -4
- package/dist/src/functions/text/generate-object.function.d.ts.map +1 -1
- package/dist/src/functions/text/generate-object.function.js +2 -2
- package/dist/src/functions/text/generate-object.function.js.map +1 -1
- package/dist/src/functions/text/generate.function.d.ts +13 -0
- package/dist/src/functions/text/generate.function.d.ts.map +1 -1
- package/dist/src/functions/text/generate.function.js +2 -2
- package/dist/src/functions/text/generate.function.js.map +1 -1
- package/package.json +8 -8
- package/.pikku/agent/pikku-agent-wirings-meta.gen.json +0 -3
- package/.pikku/agent/pikku-agent-wirings-meta.gen.ts +0 -7
- package/.pikku/agent/pikku-agent-wirings.gen.ts +0 -3
- package/.pikku/console/pikku-nodes-meta.gen.json +0 -57
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.d.ts +0 -2
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.d.ts.map +0 -1
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js +0 -7
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js.map +0 -1
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.json +0 -3
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.ts +0 -7
- package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts +0 -5
- package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts.map +0 -1
- package/dist/.pikku/agent/pikku-agent-wirings.gen.js +0 -5
- package/dist/.pikku/agent/pikku-agent-wirings.gen.js.map +0 -1
- package/dist/.pikku/agent/pikku-agent-wirings.gen.ts +0 -3
- package/dist/.pikku/console/pikku-nodes-meta.gen.json +0 -57
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.55
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* This provides the structure needed for typescript to be aware of RPCs and their return types
|
|
@@ -9,10 +9,40 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
export type
|
|
12
|
+
export type OllamaEmbedInput = {
|
|
13
|
+
/** The Ollama embedding model to use (e.g. "nomic-embed-text", "mxbai-embed-large") */
|
|
14
|
+
model: string;
|
|
15
|
+
/** The text to embed */
|
|
16
|
+
value: string;
|
|
17
|
+
}
|
|
18
|
+
export type OllamaEmbedManyInput = {
|
|
19
|
+
/** The Ollama embedding model to use (e.g. "nomic-embed-text", "mxbai-embed-large") */
|
|
20
|
+
model: string;
|
|
21
|
+
/** The texts to embed */
|
|
22
|
+
values: string[];
|
|
23
|
+
}
|
|
24
|
+
export type OllamaEmbedManyOutput = {
|
|
25
|
+
/** The embedding vectors */
|
|
26
|
+
embeddings: number[][];
|
|
27
|
+
/** Token usage statistics */
|
|
28
|
+
usage: {
|
|
29
|
+
/** Number of tokens used */
|
|
30
|
+
tokens: number;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export type OllamaEmbedOutput = {
|
|
34
|
+
/** The embedding vector */
|
|
35
|
+
embedding: number[];
|
|
36
|
+
/** Token usage statistics */
|
|
37
|
+
usage: {
|
|
38
|
+
/** Number of tokens used */
|
|
39
|
+
tokens: number;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export type OllamaGenerateObjectInput = {
|
|
13
43
|
/** The Ollama model to use (e.g. "llama3.2", "phi3:mini") */
|
|
14
44
|
model: string;
|
|
15
|
-
/** The prompt to generate
|
|
45
|
+
/** The prompt to generate a structured object from */
|
|
16
46
|
prompt?: string | undefined;
|
|
17
47
|
/** A list of messages comprising the conversation so far */
|
|
18
48
|
messages?: {
|
|
@@ -23,18 +53,24 @@ export type OllamaGenerateTextInput = {
|
|
|
23
53
|
}[] | undefined;
|
|
24
54
|
/** System message to set the behavior of the model */
|
|
25
55
|
system?: string | undefined;
|
|
56
|
+
/** JSON Schema describing the expected output object */
|
|
57
|
+
schema: {
|
|
58
|
+
[key: string]: any;
|
|
59
|
+
};
|
|
60
|
+
/** Optional name for the schema */
|
|
61
|
+
schemaName?: string | undefined;
|
|
62
|
+
/** Optional description of what the schema represents */
|
|
63
|
+
schemaDescription?: string | undefined;
|
|
64
|
+
/** Mode for object generation. Use "json" for models that do not support tools. */
|
|
65
|
+
mode?: ("auto" | "tool" | "json") | undefined;
|
|
26
66
|
/** Maximum number of tokens to generate */
|
|
27
67
|
maxTokens?: number | undefined;
|
|
28
68
|
/** Sampling temperature between 0 and 2 */
|
|
29
69
|
temperature?: number | undefined;
|
|
30
|
-
/** Nucleus sampling parameter */
|
|
31
|
-
topP?: number | undefined;
|
|
32
|
-
/** Random seed for reproducible results */
|
|
33
|
-
seed?: number | undefined;
|
|
34
70
|
}
|
|
35
|
-
export type
|
|
36
|
-
/** The generated
|
|
37
|
-
|
|
71
|
+
export type OllamaGenerateObjectOutput = {
|
|
72
|
+
/** The generated structured object */
|
|
73
|
+
object: any;
|
|
38
74
|
/** The reason the model stopped generating */
|
|
39
75
|
finishReason: string;
|
|
40
76
|
/** Token usage statistics */
|
|
@@ -47,10 +83,10 @@ export type OllamaGenerateTextOutput = {
|
|
|
47
83
|
totalTokens: number;
|
|
48
84
|
};
|
|
49
85
|
}
|
|
50
|
-
export type
|
|
86
|
+
export type OllamaGenerateTextInput = {
|
|
51
87
|
/** The Ollama model to use (e.g. "llama3.2", "phi3:mini") */
|
|
52
88
|
model: string;
|
|
53
|
-
/** The prompt to generate
|
|
89
|
+
/** The prompt to generate text from */
|
|
54
90
|
prompt?: string | undefined;
|
|
55
91
|
/** A list of messages comprising the conversation so far */
|
|
56
92
|
messages?: {
|
|
@@ -61,24 +97,18 @@ export type OllamaGenerateObjectInput = {
|
|
|
61
97
|
}[] | undefined;
|
|
62
98
|
/** System message to set the behavior of the model */
|
|
63
99
|
system?: string | undefined;
|
|
64
|
-
/** JSON Schema describing the expected output object */
|
|
65
|
-
schema: {
|
|
66
|
-
[key: string]: any;
|
|
67
|
-
};
|
|
68
|
-
/** Optional name for the schema */
|
|
69
|
-
schemaName?: string | undefined;
|
|
70
|
-
/** Optional description of what the schema represents */
|
|
71
|
-
schemaDescription?: string | undefined;
|
|
72
|
-
/** Mode for object generation. Use "json" for models that do not support tools. */
|
|
73
|
-
mode?: ("auto" | "tool" | "json") | undefined;
|
|
74
100
|
/** Maximum number of tokens to generate */
|
|
75
101
|
maxTokens?: number | undefined;
|
|
76
102
|
/** Sampling temperature between 0 and 2 */
|
|
77
103
|
temperature?: number | undefined;
|
|
104
|
+
/** Nucleus sampling parameter */
|
|
105
|
+
topP?: number | undefined;
|
|
106
|
+
/** Random seed for reproducible results */
|
|
107
|
+
seed?: number | undefined;
|
|
78
108
|
}
|
|
79
|
-
export type
|
|
80
|
-
/** The generated
|
|
81
|
-
|
|
109
|
+
export type OllamaGenerateTextOutput = {
|
|
110
|
+
/** The generated text */
|
|
111
|
+
text: string;
|
|
82
112
|
/** The reason the model stopped generating */
|
|
83
113
|
finishReason: string;
|
|
84
114
|
/** Token usage statistics */
|
|
@@ -91,36 +121,6 @@ export type OllamaGenerateObjectOutput = {
|
|
|
91
121
|
totalTokens: number;
|
|
92
122
|
};
|
|
93
123
|
}
|
|
94
|
-
export type OllamaEmbedInput = {
|
|
95
|
-
/** The Ollama embedding model to use (e.g. "nomic-embed-text", "mxbai-embed-large") */
|
|
96
|
-
model: string;
|
|
97
|
-
/** The text to embed */
|
|
98
|
-
value: string;
|
|
99
|
-
}
|
|
100
|
-
export type OllamaEmbedOutput = {
|
|
101
|
-
/** The embedding vector */
|
|
102
|
-
embedding: number[];
|
|
103
|
-
/** Token usage statistics */
|
|
104
|
-
usage: {
|
|
105
|
-
/** Number of tokens used */
|
|
106
|
-
tokens: number;
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
export type OllamaEmbedManyInput = {
|
|
110
|
-
/** The Ollama embedding model to use (e.g. "nomic-embed-text", "mxbai-embed-large") */
|
|
111
|
-
model: string;
|
|
112
|
-
/** The texts to embed */
|
|
113
|
-
values: string[];
|
|
114
|
-
}
|
|
115
|
-
export type OllamaEmbedManyOutput = {
|
|
116
|
-
/** The embedding vectors */
|
|
117
|
-
embeddings: number[][];
|
|
118
|
-
/** Token usage statistics */
|
|
119
|
-
usage: {
|
|
120
|
-
/** Number of tokens used */
|
|
121
|
-
tokens: number;
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
124
|
export type VariableSchema_ollama_base_url = string
|
|
125
125
|
|
|
126
126
|
interface RPCHandler<I, O> {
|
|
@@ -136,18 +136,27 @@ export type RPCMap = {
|
|
|
136
136
|
// No addon packages, use RPCMap directly
|
|
137
137
|
export type FlattenedRPCMap = RPCMap
|
|
138
138
|
|
|
139
|
+
type IsAny<T> = 0 extends (1 & T) ? true : false
|
|
140
|
+
type IsVoidishInput<T> = IsAny<T> extends true
|
|
141
|
+
? false
|
|
142
|
+
: [T] extends [void | null | undefined]
|
|
143
|
+
? true
|
|
144
|
+
: false
|
|
145
|
+
|
|
139
146
|
|
|
140
147
|
export type RPCInvoke = <Name extends keyof FlattenedRPCMap>(
|
|
141
|
-
|
|
142
|
-
|
|
148
|
+
...args: IsVoidishInput<FlattenedRPCMap[Name]['input']> extends true
|
|
149
|
+
? [name: Name]
|
|
150
|
+
: [name: Name, data: FlattenedRPCMap[Name]['input']]
|
|
143
151
|
) => Promise<FlattenedRPCMap[Name]['output']>
|
|
144
152
|
|
|
145
153
|
export type RPCRemote = <Name extends keyof FlattenedRPCMap>(
|
|
146
|
-
|
|
147
|
-
|
|
154
|
+
...args: IsVoidishInput<FlattenedRPCMap[Name]['input']> extends true
|
|
155
|
+
? [name: Name]
|
|
156
|
+
: [name: Name, data: FlattenedRPCMap[Name]['input']]
|
|
148
157
|
) => Promise<FlattenedRPCMap[Name]['output']>
|
|
149
158
|
|
|
150
|
-
import type {
|
|
159
|
+
import type { FlattenedWorkflowMap } from '../workflow/pikku-workflow-map.gen.d.js'
|
|
151
160
|
|
|
152
161
|
import type { AgentMap } from '../agent/pikku-agent-map.gen.d.js'
|
|
153
162
|
|
|
@@ -163,12 +172,22 @@ interface AIAgentInput {
|
|
|
163
172
|
resourceId: string
|
|
164
173
|
}
|
|
165
174
|
|
|
166
|
-
export type TypedStartWorkflow = <Name extends keyof
|
|
175
|
+
export type TypedStartWorkflow = <Name extends keyof FlattenedWorkflowMap>(
|
|
167
176
|
name: Name,
|
|
168
|
-
input:
|
|
177
|
+
input: FlattenedWorkflowMap[Name]['input'],
|
|
169
178
|
options?: { startNode?: string }
|
|
170
179
|
) => Promise<{ runId: string }>
|
|
171
180
|
|
|
181
|
+
export type TypedRunWorkflow = <Name extends keyof FlattenedWorkflowMap>(
|
|
182
|
+
name: Name,
|
|
183
|
+
input: FlattenedWorkflowMap[Name]['input']
|
|
184
|
+
) => Promise<FlattenedWorkflowMap[Name]['output']>
|
|
185
|
+
|
|
186
|
+
export type TypedWorkflowStatus = (
|
|
187
|
+
workflowName: string,
|
|
188
|
+
runId: string
|
|
189
|
+
) => Promise<{ id: string; status: 'running' | 'suspended' | 'completed' | 'failed' | 'cancelled'; output?: unknown; error?: { message?: string } }>
|
|
190
|
+
|
|
172
191
|
type TypedAgentRun = [keyof FlattenedAgentMap] extends [never]
|
|
173
192
|
? (name: string, input: AIAgentInput) => Promise<any>
|
|
174
193
|
: <Name extends keyof FlattenedAgentMap>(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.55
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* This provides the structure needed for typescript to be aware of RPCs and their return types
|
|
@@ -9,10 +9,40 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
export type
|
|
12
|
+
export type OllamaEmbedInput = {
|
|
13
|
+
/** The Ollama embedding model to use (e.g. "nomic-embed-text", "mxbai-embed-large") */
|
|
14
|
+
model: string;
|
|
15
|
+
/** The text to embed */
|
|
16
|
+
value: string;
|
|
17
|
+
}
|
|
18
|
+
export type OllamaEmbedManyInput = {
|
|
19
|
+
/** The Ollama embedding model to use (e.g. "nomic-embed-text", "mxbai-embed-large") */
|
|
20
|
+
model: string;
|
|
21
|
+
/** The texts to embed */
|
|
22
|
+
values: string[];
|
|
23
|
+
}
|
|
24
|
+
export type OllamaEmbedManyOutput = {
|
|
25
|
+
/** The embedding vectors */
|
|
26
|
+
embeddings: number[][];
|
|
27
|
+
/** Token usage statistics */
|
|
28
|
+
usage: {
|
|
29
|
+
/** Number of tokens used */
|
|
30
|
+
tokens: number;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export type OllamaEmbedOutput = {
|
|
34
|
+
/** The embedding vector */
|
|
35
|
+
embedding: number[];
|
|
36
|
+
/** Token usage statistics */
|
|
37
|
+
usage: {
|
|
38
|
+
/** Number of tokens used */
|
|
39
|
+
tokens: number;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export type OllamaGenerateObjectInput = {
|
|
13
43
|
/** The Ollama model to use (e.g. "llama3.2", "phi3:mini") */
|
|
14
44
|
model: string;
|
|
15
|
-
/** The prompt to generate
|
|
45
|
+
/** The prompt to generate a structured object from */
|
|
16
46
|
prompt?: string | undefined;
|
|
17
47
|
/** A list of messages comprising the conversation so far */
|
|
18
48
|
messages?: {
|
|
@@ -23,18 +53,24 @@ export type OllamaGenerateTextInput = {
|
|
|
23
53
|
}[] | undefined;
|
|
24
54
|
/** System message to set the behavior of the model */
|
|
25
55
|
system?: string | undefined;
|
|
56
|
+
/** JSON Schema describing the expected output object */
|
|
57
|
+
schema: {
|
|
58
|
+
[key: string]: any;
|
|
59
|
+
};
|
|
60
|
+
/** Optional name for the schema */
|
|
61
|
+
schemaName?: string | undefined;
|
|
62
|
+
/** Optional description of what the schema represents */
|
|
63
|
+
schemaDescription?: string | undefined;
|
|
64
|
+
/** Mode for object generation. Use "json" for models that do not support tools. */
|
|
65
|
+
mode?: ("auto" | "tool" | "json") | undefined;
|
|
26
66
|
/** Maximum number of tokens to generate */
|
|
27
67
|
maxTokens?: number | undefined;
|
|
28
68
|
/** Sampling temperature between 0 and 2 */
|
|
29
69
|
temperature?: number | undefined;
|
|
30
|
-
/** Nucleus sampling parameter */
|
|
31
|
-
topP?: number | undefined;
|
|
32
|
-
/** Random seed for reproducible results */
|
|
33
|
-
seed?: number | undefined;
|
|
34
70
|
}
|
|
35
|
-
export type
|
|
36
|
-
/** The generated
|
|
37
|
-
|
|
71
|
+
export type OllamaGenerateObjectOutput = {
|
|
72
|
+
/** The generated structured object */
|
|
73
|
+
object: any;
|
|
38
74
|
/** The reason the model stopped generating */
|
|
39
75
|
finishReason: string;
|
|
40
76
|
/** Token usage statistics */
|
|
@@ -47,10 +83,10 @@ export type OllamaGenerateTextOutput = {
|
|
|
47
83
|
totalTokens: number;
|
|
48
84
|
};
|
|
49
85
|
}
|
|
50
|
-
export type
|
|
86
|
+
export type OllamaGenerateTextInput = {
|
|
51
87
|
/** The Ollama model to use (e.g. "llama3.2", "phi3:mini") */
|
|
52
88
|
model: string;
|
|
53
|
-
/** The prompt to generate
|
|
89
|
+
/** The prompt to generate text from */
|
|
54
90
|
prompt?: string | undefined;
|
|
55
91
|
/** A list of messages comprising the conversation so far */
|
|
56
92
|
messages?: {
|
|
@@ -61,24 +97,18 @@ export type OllamaGenerateObjectInput = {
|
|
|
61
97
|
}[] | undefined;
|
|
62
98
|
/** System message to set the behavior of the model */
|
|
63
99
|
system?: string | undefined;
|
|
64
|
-
/** JSON Schema describing the expected output object */
|
|
65
|
-
schema: {
|
|
66
|
-
[key: string]: any;
|
|
67
|
-
};
|
|
68
|
-
/** Optional name for the schema */
|
|
69
|
-
schemaName?: string | undefined;
|
|
70
|
-
/** Optional description of what the schema represents */
|
|
71
|
-
schemaDescription?: string | undefined;
|
|
72
|
-
/** Mode for object generation. Use "json" for models that do not support tools. */
|
|
73
|
-
mode?: ("auto" | "tool" | "json") | undefined;
|
|
74
100
|
/** Maximum number of tokens to generate */
|
|
75
101
|
maxTokens?: number | undefined;
|
|
76
102
|
/** Sampling temperature between 0 and 2 */
|
|
77
103
|
temperature?: number | undefined;
|
|
104
|
+
/** Nucleus sampling parameter */
|
|
105
|
+
topP?: number | undefined;
|
|
106
|
+
/** Random seed for reproducible results */
|
|
107
|
+
seed?: number | undefined;
|
|
78
108
|
}
|
|
79
|
-
export type
|
|
80
|
-
/** The generated
|
|
81
|
-
|
|
109
|
+
export type OllamaGenerateTextOutput = {
|
|
110
|
+
/** The generated text */
|
|
111
|
+
text: string;
|
|
82
112
|
/** The reason the model stopped generating */
|
|
83
113
|
finishReason: string;
|
|
84
114
|
/** Token usage statistics */
|
|
@@ -91,36 +121,6 @@ export type OllamaGenerateObjectOutput = {
|
|
|
91
121
|
totalTokens: number;
|
|
92
122
|
};
|
|
93
123
|
}
|
|
94
|
-
export type OllamaEmbedInput = {
|
|
95
|
-
/** The Ollama embedding model to use (e.g. "nomic-embed-text", "mxbai-embed-large") */
|
|
96
|
-
model: string;
|
|
97
|
-
/** The text to embed */
|
|
98
|
-
value: string;
|
|
99
|
-
}
|
|
100
|
-
export type OllamaEmbedOutput = {
|
|
101
|
-
/** The embedding vector */
|
|
102
|
-
embedding: number[];
|
|
103
|
-
/** Token usage statistics */
|
|
104
|
-
usage: {
|
|
105
|
-
/** Number of tokens used */
|
|
106
|
-
tokens: number;
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
export type OllamaEmbedManyInput = {
|
|
110
|
-
/** The Ollama embedding model to use (e.g. "nomic-embed-text", "mxbai-embed-large") */
|
|
111
|
-
model: string;
|
|
112
|
-
/** The texts to embed */
|
|
113
|
-
values: string[];
|
|
114
|
-
}
|
|
115
|
-
export type OllamaEmbedManyOutput = {
|
|
116
|
-
/** The embedding vectors */
|
|
117
|
-
embeddings: number[][];
|
|
118
|
-
/** Token usage statistics */
|
|
119
|
-
usage: {
|
|
120
|
-
/** Number of tokens used */
|
|
121
|
-
tokens: number;
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
124
|
export type VariableSchema_ollama_base_url = string
|
|
125
125
|
|
|
126
126
|
interface RPCHandler<I, O> {
|
|
@@ -129,10 +129,10 @@ interface RPCHandler<I, O> {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
export type RPCMap = {
|
|
132
|
-
readonly 'ollamaGenerateText': RPCHandler<OllamaGenerateTextInput, OllamaGenerateTextOutput>,
|
|
133
|
-
readonly 'ollamaGenerateObject': RPCHandler<OllamaGenerateObjectInput, OllamaGenerateObjectOutput>,
|
|
134
|
-
readonly 'ollamaEmbed': RPCHandler<OllamaEmbedInput, OllamaEmbedOutput>,
|
|
135
132
|
readonly 'ollamaEmbedMany': RPCHandler<OllamaEmbedManyInput, OllamaEmbedManyOutput>,
|
|
133
|
+
readonly 'ollamaEmbed': RPCHandler<OllamaEmbedInput, OllamaEmbedOutput>,
|
|
134
|
+
readonly 'ollamaGenerateObject': RPCHandler<OllamaGenerateObjectInput, OllamaGenerateObjectOutput>,
|
|
135
|
+
readonly 'ollamaGenerateText': RPCHandler<OllamaGenerateTextInput, OllamaGenerateTextOutput>,
|
|
136
136
|
};
|
|
137
137
|
|
|
138
138
|
|
|
@@ -140,18 +140,27 @@ export type RPCMap = {
|
|
|
140
140
|
// No addon packages, use RPCMap directly
|
|
141
141
|
export type FlattenedRPCMap = RPCMap
|
|
142
142
|
|
|
143
|
+
type IsAny<T> = 0 extends (1 & T) ? true : false
|
|
144
|
+
type IsVoidishInput<T> = IsAny<T> extends true
|
|
145
|
+
? false
|
|
146
|
+
: [T] extends [void | null | undefined]
|
|
147
|
+
? true
|
|
148
|
+
: false
|
|
149
|
+
|
|
143
150
|
|
|
144
151
|
export type RPCInvoke = <Name extends keyof FlattenedRPCMap>(
|
|
145
|
-
|
|
146
|
-
|
|
152
|
+
...args: IsVoidishInput<FlattenedRPCMap[Name]['input']> extends true
|
|
153
|
+
? [name: Name]
|
|
154
|
+
: [name: Name, data: FlattenedRPCMap[Name]['input']]
|
|
147
155
|
) => Promise<FlattenedRPCMap[Name]['output']>
|
|
148
156
|
|
|
149
157
|
export type RPCRemote = <Name extends keyof FlattenedRPCMap>(
|
|
150
|
-
|
|
151
|
-
|
|
158
|
+
...args: IsVoidishInput<FlattenedRPCMap[Name]['input']> extends true
|
|
159
|
+
? [name: Name]
|
|
160
|
+
: [name: Name, data: FlattenedRPCMap[Name]['input']]
|
|
152
161
|
) => Promise<FlattenedRPCMap[Name]['output']>
|
|
153
162
|
|
|
154
|
-
import type {
|
|
163
|
+
import type { FlattenedWorkflowMap } from '../workflow/pikku-workflow-map.gen.d.js'
|
|
155
164
|
|
|
156
165
|
import type { AgentMap } from '../agent/pikku-agent-map.gen.d.js'
|
|
157
166
|
|
|
@@ -167,12 +176,22 @@ interface AIAgentInput {
|
|
|
167
176
|
resourceId: string
|
|
168
177
|
}
|
|
169
178
|
|
|
170
|
-
export type TypedStartWorkflow = <Name extends keyof
|
|
179
|
+
export type TypedStartWorkflow = <Name extends keyof FlattenedWorkflowMap>(
|
|
171
180
|
name: Name,
|
|
172
|
-
input:
|
|
181
|
+
input: FlattenedWorkflowMap[Name]['input'],
|
|
173
182
|
options?: { startNode?: string }
|
|
174
183
|
) => Promise<{ runId: string }>
|
|
175
184
|
|
|
185
|
+
export type TypedRunWorkflow = <Name extends keyof FlattenedWorkflowMap>(
|
|
186
|
+
name: Name,
|
|
187
|
+
input: FlattenedWorkflowMap[Name]['input']
|
|
188
|
+
) => Promise<FlattenedWorkflowMap[Name]['output']>
|
|
189
|
+
|
|
190
|
+
export type TypedWorkflowStatus = (
|
|
191
|
+
workflowName: string,
|
|
192
|
+
runId: string
|
|
193
|
+
) => Promise<{ id: string; status: 'running' | 'suspended' | 'completed' | 'failed' | 'cancelled'; output?: unknown; error?: { message?: string } }>
|
|
194
|
+
|
|
176
195
|
type TypedAgentRun = [keyof FlattenedAgentMap] extends [never]
|
|
177
196
|
? (name: string, input: AIAgentInput) => Promise<any>
|
|
178
197
|
: <Name extends keyof FlattenedAgentMap>(
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.55
|
|
3
|
+
*/
|
|
4
|
+
import { pikkuState } from '@pikku/core/internal'
|
|
5
|
+
import metaData from './pikku-rpc-wirings-meta.internal.gen.json' with { type: 'json' }
|
|
6
|
+
pikkuState('@pikku/addon-ollama', 'rpc', 'meta', metaData as Record<string, string>)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.55
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Scheduler-specific type definitions for tree-shaking optimization
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { CoreScheduledTask, wireScheduler as wireSchedulerCore } from '@pikku/core/scheduler'
|
|
9
|
+
import type { PikkuFunctionConfig, PikkuMiddleware } from '../function/pikku-function-types.gen.js'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Type definition for scheduled tasks that run at specified intervals.
|
|
13
|
+
* These are sessionless functions that execute based on cron expressions.
|
|
14
|
+
*/
|
|
15
|
+
type SchedulerWiring = CoreScheduledTask<PikkuFunctionConfig<void, void, 'session' | 'rpc'>, PikkuMiddleware>
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Registers a scheduled task with the Pikku framework.
|
|
19
|
+
* Tasks run based on cron expressions and are sessionless.
|
|
20
|
+
*
|
|
21
|
+
* @param task - Scheduled task definition with cron expression and handler
|
|
22
|
+
*/
|
|
23
|
+
export const wireScheduler = (task: SchedulerWiring) => {
|
|
24
|
+
wireSchedulerCore(task as any)
|
|
25
|
+
}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.55
|
|
3
3
|
*/
|
|
4
4
|
import { addSchema } from '@pikku/core/schema'
|
|
5
5
|
|
|
6
|
-
import * as
|
|
7
|
-
addSchema('
|
|
6
|
+
import * as OllamaEmbedInput from './schemas/OllamaEmbedInput.schema.json' with { type: 'json' }
|
|
7
|
+
addSchema('OllamaEmbedInput', OllamaEmbedInput, '@pikku/addon-ollama')
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
import * as
|
|
11
|
-
addSchema('
|
|
10
|
+
import * as OllamaEmbedManyInput from './schemas/OllamaEmbedManyInput.schema.json' with { type: 'json' }
|
|
11
|
+
addSchema('OllamaEmbedManyInput', OllamaEmbedManyInput, '@pikku/addon-ollama')
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
import * as
|
|
15
|
-
addSchema('
|
|
14
|
+
import * as OllamaEmbedManyOutput from './schemas/OllamaEmbedManyOutput.schema.json' with { type: 'json' }
|
|
15
|
+
addSchema('OllamaEmbedManyOutput', OllamaEmbedManyOutput, '@pikku/addon-ollama')
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
import * as
|
|
19
|
-
addSchema('
|
|
18
|
+
import * as OllamaEmbedOutput from './schemas/OllamaEmbedOutput.schema.json' with { type: 'json' }
|
|
19
|
+
addSchema('OllamaEmbedOutput', OllamaEmbedOutput, '@pikku/addon-ollama')
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
import * as
|
|
23
|
-
addSchema('
|
|
22
|
+
import * as OllamaGenerateObjectInput from './schemas/OllamaGenerateObjectInput.schema.json' with { type: 'json' }
|
|
23
|
+
addSchema('OllamaGenerateObjectInput', OllamaGenerateObjectInput, '@pikku/addon-ollama')
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
import * as
|
|
27
|
-
addSchema('
|
|
26
|
+
import * as OllamaGenerateObjectOutput from './schemas/OllamaGenerateObjectOutput.schema.json' with { type: 'json' }
|
|
27
|
+
addSchema('OllamaGenerateObjectOutput', OllamaGenerateObjectOutput, '@pikku/addon-ollama')
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
import * as
|
|
31
|
-
addSchema('
|
|
30
|
+
import * as OllamaGenerateTextInput from './schemas/OllamaGenerateTextInput.schema.json' with { type: 'json' }
|
|
31
|
+
addSchema('OllamaGenerateTextInput', OllamaGenerateTextInput, '@pikku/addon-ollama')
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
import * as
|
|
35
|
-
addSchema('
|
|
34
|
+
import * as OllamaGenerateTextOutput from './schemas/OllamaGenerateTextOutput.schema.json' with { type: 'json' }
|
|
35
|
+
addSchema('OllamaGenerateTextOutput', OllamaGenerateTextOutput, '@pikku/addon-ollama')
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
import * as VariableSchema_ollama_base_url from './schemas/VariableSchema_ollama_base_url.schema.json' with { type: 'json' }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.55
|
|
3
3
|
*/
|
|
4
4
|
import { TypedSecretService as CoreTypedSecretService, type CredentialMeta } from '@pikku/core/services'
|
|
5
5
|
import type { SecretService } from '@pikku/core/services'
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"description": "Base URL for the Ollama API",
|
|
6
6
|
"variableId": "OLLAMA_BASE_URL",
|
|
7
7
|
"schema": "VariableSchema_ollama_base_url",
|
|
8
|
-
"sourceFile": "/
|
|
8
|
+
"sourceFile": "/home/runner/work/addons/addons/packages/ai/ollama/src/ollama.variable.ts"
|
|
9
9
|
}
|
|
10
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.55
|
|
3
3
|
*/
|
|
4
4
|
import { TypedVariablesService as CoreTypedVariablesService, type VariableMeta } from '@pikku/core/services'
|
|
5
5
|
import type { VariablesService } from '@pikku/core/services'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.55
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Workflow type map with input/output types for each workflow
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
|
|
11
12
|
interface WorkflowHandler<I, O> {
|
|
12
13
|
input: I;
|
|
13
14
|
output: O;
|
|
@@ -23,12 +24,15 @@ export type WorkflowMap = {
|
|
|
23
24
|
export type GraphsMap = {
|
|
24
25
|
};
|
|
25
26
|
|
|
26
|
-
export type
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
export type FlattenedWorkflowMap = WorkflowMap
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
export type WorkflowClient<Name extends keyof FlattenedWorkflowMap> = {
|
|
31
|
+
start: (input: FlattenedWorkflowMap[Name]['input']) => Promise<{ runId: string }>;
|
|
32
|
+
getRun: <output extends keyof FlattenedWorkflowMap[Name]>(runId: string) => Promise<FlattenedWorkflowMap[Name][output]>;
|
|
29
33
|
cancelRun: (runId: string) => Promise<boolean>;
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
export type TypedWorkflowClients = {
|
|
33
|
-
[Name in keyof
|
|
37
|
+
[Name in keyof FlattenedWorkflowMap]: WorkflowClient<Name>;
|
|
34
38
|
}
|