@activepieces/piece-localai 0.0.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.
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # pieces-localai
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Running lint
6
+
7
+ Run `nx lint pieces-localai` to execute the lint via [ESLint](https://eslint.org/).
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@activepieces/piece-localai",
3
+ "version": "0.0.1",
4
+ "dependencies": {
5
+ "@sinclair/typebox": "0.26.8",
6
+ "axios": "1.4.0",
7
+ "dayjs": "1.11.9",
8
+ "is-base64": "1.1.0",
9
+ "lodash": "4.17.21",
10
+ "nanoid": "3.3.6",
11
+ "openai": "3.3.0",
12
+ "semver": "7.5.4",
13
+ "@activepieces/pieces-common": "0.2.3",
14
+ "@activepieces/pieces-framework": "0.6.18",
15
+ "@activepieces/shared": "0.8.4",
16
+ "tslib": "2.6.1"
17
+ },
18
+ "main": "./src/index.js",
19
+ "types": "./src/index.d.ts"
20
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ export declare const localaiAuth: import("@activepieces/pieces-framework").CustomAuthProperty<true, {
2
+ base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ access_token: import("@activepieces/pieces-framework").SecretTextProperty<false>;
4
+ }>;
5
+ export declare const openai: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").CustomAuthProperty<true, {
6
+ base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
+ access_token: import("@activepieces/pieces-framework").SecretTextProperty<false>;
8
+ }>>;
package/src/index.js ADDED
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.openai = exports.localaiAuth = void 0;
4
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
5
+ const send_prompt_1 = require("./lib/actions/send-prompt");
6
+ exports.localaiAuth = pieces_framework_1.PieceAuth.CustomAuth({
7
+ props: {
8
+ base_url: pieces_framework_1.Property.ShortText({
9
+ displayName: "Server URL",
10
+ description: "LocalAI Instance URL",
11
+ required: true,
12
+ }),
13
+ access_token: pieces_framework_1.PieceAuth.SecretText({
14
+ displayName: "Access Token",
15
+ description: "LocalAI Access Token",
16
+ required: false,
17
+ })
18
+ },
19
+ required: true,
20
+ });
21
+ exports.openai = (0, pieces_framework_1.createPiece)({
22
+ displayName: 'LocalAI',
23
+ description: 'Use LocalAi to generate text',
24
+ minimumSupportedRelease: '0.5.0',
25
+ logoUrl: 'https://cdn.activepieces.com/pieces/localai.jpeg',
26
+ auth: exports.localaiAuth,
27
+ actions: [send_prompt_1.askLocalAI],
28
+ authors: ['hboujrida'],
29
+ triggers: []
30
+ });
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/localai/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAAiF;AACjF,2DAAuD;AAE1C,QAAA,WAAW,GAAG,4BAAS,CAAC,UAAU,CAAC;IAE9C,KAAK,EAAE;QACH,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,sBAAsB;YACnC,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,YAAY,EAAE,4BAAS,CAAC,UAAU,CAAC;YAC/B,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,sBAAsB;YACnC,QAAQ,EAAE,KAAK;SAClB,CAAC;KACL;IACD,QAAQ,EAAE,IAAI;CACf,CAAC,CAAA;AACW,QAAA,MAAM,GAAG,IAAA,8BAAW,EAAC;IAChC,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,8BAA8B;IAC3C,uBAAuB,EAAE,OAAO;IAChC,OAAO,EAAE,kDAAkD;IAC3D,IAAI,EAAE,mBAAW;IACjB,OAAO,EAAE,CAAC,wBAAU,CAAC;IACrB,OAAO,EAAE,CAAC,WAAW,CAAC;IACtB,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ export declare const askLocalAI: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<true, {
2
+ base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ access_token: import("@activepieces/pieces-framework").SecretTextProperty<false>;
4
+ }>, {
5
+ model: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
6
+ prompt: import("@activepieces/pieces-framework").LongTextProperty<true>;
7
+ temperature: import("@activepieces/pieces-framework").NumberProperty<false>;
8
+ maxTokens: import("@activepieces/pieces-framework").NumberProperty<false>;
9
+ topP: import("@activepieces/pieces-framework").NumberProperty<false>;
10
+ frequencyPenalty: import("@activepieces/pieces-framework").NumberProperty<false>;
11
+ presencePenalty: import("@activepieces/pieces-framework").NumberProperty<false>;
12
+ roles: import("@activepieces/pieces-framework").JsonProperty<false>;
13
+ }>;
@@ -0,0 +1,210 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.askLocalAI = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const openai_1 = require("openai");
7
+ const pieces_common_1 = require("@activepieces/pieces-common");
8
+ const __1 = require("../..");
9
+ const billingIssueMessage = `Error Occurred: 429 \n
10
+
11
+ 1. Set LocalAI API Url. \n
12
+ 2. Generate a new API key (optional). \n
13
+ 3. Attempt the process again. \n
14
+
15
+ For guidance, visit: https://localai.io/`;
16
+ const unaurthorizedMessage = `Error Occurred: 401 \n
17
+
18
+ Ensure that your API key is valid. \n
19
+ `;
20
+ exports.askLocalAI = (0, pieces_framework_1.createAction)({
21
+ auth: __1.localaiAuth,
22
+ name: 'ask_localai',
23
+ displayName: 'Ask LocalAI',
24
+ description: 'Ask LocalAI anything you want!',
25
+ props: {
26
+ model: pieces_framework_1.Property.Dropdown({
27
+ displayName: 'Model',
28
+ required: true,
29
+ description: 'The model which will generate the completion. Some models are suitable for natural language tasks, others specialize in code.',
30
+ refreshers: [],
31
+ defaultValue: 'gpt-3.5-turbo',
32
+ options: ({ auth }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
33
+ if (!auth) {
34
+ return {
35
+ disabled: true,
36
+ placeholder: 'Enter your api key first',
37
+ options: []
38
+ };
39
+ }
40
+ try {
41
+ const response = yield pieces_common_1.httpClient.sendRequest({
42
+ url: auth.base_url + '/v1/models',
43
+ method: pieces_common_1.HttpMethod.GET,
44
+ authentication: {
45
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
46
+ token: auth.access_token
47
+ }
48
+ });
49
+ return {
50
+ disabled: false,
51
+ options: response.body.data.map((model) => {
52
+ return {
53
+ label: model.id,
54
+ value: model.id
55
+ };
56
+ })
57
+ };
58
+ }
59
+ catch (error) {
60
+ return {
61
+ disabled: true,
62
+ options: [],
63
+ placeholder: "Couldn't Load Models"
64
+ };
65
+ }
66
+ })
67
+ }),
68
+ prompt: pieces_framework_1.Property.LongText({
69
+ displayName: 'Question',
70
+ required: true
71
+ }),
72
+ temperature: pieces_framework_1.Property.Number({
73
+ displayName: 'Temperature',
74
+ required: false,
75
+ description: 'Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.',
76
+ validators: [pieces_framework_1.Validators.minValue(0), pieces_framework_1.Validators.maxValue(1.0)]
77
+ }),
78
+ maxTokens: pieces_framework_1.Property.Number({
79
+ displayName: 'Maximum Tokens',
80
+ required: false,
81
+ description: "The maximum number of tokens to generate. Requests can use up to 2,048 or 4,096 tokens shared between prompt and completion, don't set the value to maximum and leave some tokens for the input. The exact limit varies by model. (One token is roughly 4 characters for normal English text)"
82
+ }),
83
+ topP: pieces_framework_1.Property.Number({
84
+ displayName: 'Top P',
85
+ required: false,
86
+ description: 'An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.'
87
+ }),
88
+ frequencyPenalty: pieces_framework_1.Property.Number({
89
+ displayName: 'Frequency penalty',
90
+ required: false,
91
+ description: "Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."
92
+ }),
93
+ presencePenalty: pieces_framework_1.Property.Number({
94
+ displayName: 'Presence penalty',
95
+ required: false,
96
+ description: "Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the mode's likelihood to talk about new topics."
97
+ }),
98
+ roles: pieces_framework_1.Property.Json({
99
+ displayName: 'Roles',
100
+ required: false,
101
+ description: 'Array of roles to specify more accurate response',
102
+ defaultValue: [
103
+ { role: 'system', content: 'You are a helpful assistant.' },
104
+ ]
105
+ })
106
+ },
107
+ run({ auth, propsValue }) {
108
+ var _a, _b, _c, _d, _e, _f, _g;
109
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
110
+ const configuration = new openai_1.Configuration({
111
+ basePath: auth.base_url,
112
+ apiKey: auth.access_token
113
+ });
114
+ const openai = new openai_1.OpenAIApi(configuration);
115
+ let billingIssue = false;
116
+ let unaurthorized = false;
117
+ let model = 'gpt-3.5-turbo';
118
+ if (propsValue.model) {
119
+ model = propsValue.model;
120
+ }
121
+ let temperature = 0.9;
122
+ if (propsValue.temperature) {
123
+ temperature = Number(propsValue.temperature);
124
+ }
125
+ let maxTokens = 2048;
126
+ if (propsValue.maxTokens) {
127
+ maxTokens = Number(propsValue.maxTokens);
128
+ }
129
+ let topP = 1;
130
+ if (propsValue.topP) {
131
+ topP = Number(propsValue.topP);
132
+ }
133
+ let frequencyPenalty = 0.0;
134
+ if (propsValue.frequencyPenalty) {
135
+ frequencyPenalty = Number(propsValue.frequencyPenalty);
136
+ }
137
+ let presencePenalty = 0.6;
138
+ if (propsValue.presencePenalty) {
139
+ presencePenalty = Number(propsValue.presencePenalty);
140
+ }
141
+ const rolesArray = propsValue.roles
142
+ ? propsValue.roles
143
+ : [];
144
+ const roles = rolesArray.map((item) => {
145
+ const rolesEnum = ['system', 'user', 'assistant'];
146
+ if (!rolesEnum.includes(item.role)) {
147
+ throw new Error('The only available roles are: [system, user, assistant]');
148
+ }
149
+ return {
150
+ role: item.role,
151
+ content: item.content
152
+ };
153
+ });
154
+ const maxRetries = 4;
155
+ let retries = 0;
156
+ let response;
157
+ while (retries < maxRetries) {
158
+ try {
159
+ response = (_e = (_d = (_c = (_b = (_a = (yield openai.createChatCompletion({
160
+ model: model,
161
+ messages: [
162
+ ...roles,
163
+ {
164
+ role: 'user',
165
+ content: propsValue['prompt']
166
+ }
167
+ ],
168
+ temperature: temperature,
169
+ max_tokens: maxTokens,
170
+ top_p: topP,
171
+ frequency_penalty: frequencyPenalty,
172
+ presence_penalty: presencePenalty
173
+ }))) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.choices[0]) === null || _c === void 0 ? void 0 : _c.message) === null || _d === void 0 ? void 0 : _d.content) === null || _e === void 0 ? void 0 : _e.trim();
174
+ break; // Break out of the loop if the request is successful
175
+ }
176
+ catch (error) {
177
+ if ((_f = error === null || error === void 0 ? void 0 : error.message) === null || _f === void 0 ? void 0 : _f.includes('code 429')) {
178
+ billingIssue = true;
179
+ if (retries + 1 === maxRetries) {
180
+ throw error;
181
+ }
182
+ // Calculate the time delay for the next retry using exponential backoff
183
+ const delay = Math.pow(6, retries) * 1000;
184
+ console.log(`Retrying in ${delay} milliseconds...`);
185
+ yield sleep(delay); // Wait for the calculated delay
186
+ retries++;
187
+ break;
188
+ }
189
+ else {
190
+ if ((_g = error === null || error === void 0 ? void 0 : error.message) === null || _g === void 0 ? void 0 : _g.includes('code 401')) {
191
+ unaurthorized = true;
192
+ }
193
+ throw error;
194
+ }
195
+ }
196
+ }
197
+ if (billingIssue) {
198
+ throw new Error(billingIssueMessage);
199
+ }
200
+ if (unaurthorized) {
201
+ throw new Error(unaurthorizedMessage);
202
+ }
203
+ return response;
204
+ });
205
+ }
206
+ });
207
+ function sleep(ms) {
208
+ return new Promise((resolve) => setTimeout(resolve, ms));
209
+ }
210
+ //# sourceMappingURL=send-prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send-prompt.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/localai/src/lib/actions/send-prompt.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,mCAAgF;AAChF,+DAIqC;AACrC,6BAAoC;AAGpC,MAAM,mBAAmB,GAAG;;;;;;yCAMa,CAAA;AAEzC,MAAM,oBAAoB,GAAG;;;CAG5B,CAAA;AAEY,QAAA,UAAU,GAAG,IAAA,+BAAY,EAAC;IACrC,IAAI,EAAE,eAAW;IACjB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,gCAAgC;IAC7C,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACvB,WAAW,EAAE,OAAO;YACpB,QAAQ,EAAE,IAAI;YACd,WAAW,EACT,+HAA+H;YACjI,UAAU,EAAE,EAAE;YACd,YAAY,EAAE,eAAe;YAC7B,OAAO,EAAE,CAAO,EAAE,IAAI,EAAE,EAAE,EAAE;gBAC1B,IAAI,CAAC,IAAI,EAAE;oBACT,OAAO;wBACL,QAAQ,EAAE,IAAI;wBACd,WAAW,EAAE,0BAA0B;wBACvC,OAAO,EAAE,EAAE;qBACZ,CAAC;iBACH;gBACD,IAAI;oBACF,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAE1C;wBACD,GAAG,EAAQ,IAAK,CAAC,QAAQ,GAAE,YAAY;wBACvC,MAAM,EAAE,0BAAU,CAAC,GAAG;wBACtB,cAAc,EAAE;4BACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;4BACrC,KAAK,EAAQ,IAAK,CAAC,YAAsB;yBAC1C;qBACF,CAAC,CAAC;oBACH,OAAO;wBACL,QAAQ,EAAE,KAAK;wBACf,OAAO,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