@banumeow/n8n-nodes-oracle-cloud 1.3.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/LICENSE.md +27 -0
- package/README.md +36 -0
- package/dist/credentials/OciApi.credentials.d.ts +11 -0
- package/dist/credentials/OciApi.credentials.js +74 -0
- package/dist/credentials/OciApi.credentials.js.map +1 -0
- package/dist/credentials/OracleDatabaseApi.credentials.d.ts +11 -0
- package/dist/credentials/OracleDatabaseApi.credentials.js +57 -0
- package/dist/credentials/OracleDatabaseApi.credentials.js.map +1 -0
- package/dist/credentials/icons/oracle.svg +3 -0
- package/dist/nodes/OCI/AISpeech/oracle.svg +3 -0
- package/dist/nodes/OCI/GenerativeAI/EmbeddingsOciGenerativeAi.node.d.ts +10 -0
- package/dist/nodes/OCI/GenerativeAI/EmbeddingsOciGenerativeAi.node.js +105 -0
- package/dist/nodes/OCI/GenerativeAI/EmbeddingsOciGenerativeAi.node.js.map +1 -0
- package/dist/nodes/OCI/GenerativeAI/LmChatOciGenerativeAi.node.d.ts +10 -0
- package/dist/nodes/OCI/GenerativeAI/LmChatOciGenerativeAi.node.js +169 -0
- package/dist/nodes/OCI/GenerativeAI/LmChatOciGenerativeAi.node.js.map +1 -0
- package/dist/nodes/OCI/GenerativeAI/langchain/ChatOci.d.ts +40 -0
- package/dist/nodes/OCI/GenerativeAI/langchain/ChatOci.js +377 -0
- package/dist/nodes/OCI/GenerativeAI/langchain/ChatOci.js.map +1 -0
- package/dist/nodes/OCI/GenerativeAI/langchain/OciEmbedings.d.ts +21 -0
- package/dist/nodes/OCI/GenerativeAI/langchain/OciEmbedings.js +84 -0
- package/dist/nodes/OCI/GenerativeAI/langchain/OciEmbedings.js.map +1 -0
- package/dist/nodes/OCI/GenerativeAI/oracle.svg +3 -0
- package/dist/nodes/OCI/Loaders/SimpleLoaders.d.ts +12 -0
- package/dist/nodes/OCI/Loaders/SimpleLoaders.js +58 -0
- package/dist/nodes/OCI/Loaders/SimpleLoaders.js.map +1 -0
- package/dist/nodes/OCI/N8nBinaryLoader.d.ts +18 -0
- package/dist/nodes/OCI/N8nBinaryLoader.js +168 -0
- package/dist/nodes/OCI/N8nBinaryLoader.js.map +1 -0
- package/dist/nodes/OCI/N8nJsonLoader.d.ts +11 -0
- package/dist/nodes/OCI/N8nJsonLoader.js +76 -0
- package/dist/nodes/OCI/N8nJsonLoader.js.map +1 -0
- package/dist/nodes/OCI/N8nLlmTracing.d.ts +46 -0
- package/dist/nodes/OCI/N8nLlmTracing.js +169 -0
- package/dist/nodes/OCI/N8nLlmTracing.js.map +1 -0
- package/dist/nodes/OCI/SpeechTranscriptionOci/SpeechTranscriptionOci.node.d.ts +5 -0
- package/dist/nodes/OCI/SpeechTranscriptionOci/SpeechTranscriptionOci.node.js +416 -0
- package/dist/nodes/OCI/SpeechTranscriptionOci/SpeechTranscriptionOci.node.js.map +1 -0
- package/dist/nodes/OCI/SpeechTranscriptionOci/oracle.svg +3 -0
- package/dist/nodes/OCI/VectorStore/VectorStoreOracle.node.d.ts +5 -0
- package/dist/nodes/OCI/VectorStore/VectorStoreOracle.node.js +113 -0
- package/dist/nodes/OCI/VectorStore/VectorStoreOracle.node.js.map +1 -0
- package/dist/nodes/OCI/VectorStore/VectorStoreOracleInsert.node.d.ts +5 -0
- package/dist/nodes/OCI/VectorStore/VectorStoreOracleInsert.node.js +100 -0
- package/dist/nodes/OCI/VectorStore/VectorStoreOracleInsert.node.js.map +1 -0
- package/dist/nodes/OCI/VectorStore/VectorStoreOracleTool.node.d.ts +6 -0
- package/dist/nodes/OCI/VectorStore/VectorStoreOracleTool.node.js +253 -0
- package/dist/nodes/OCI/VectorStore/VectorStoreOracleTool.node.js.map +1 -0
- package/dist/nodes/OCI/VectorStore/langchain/OracleDbVectorStore.d.ts +45 -0
- package/dist/nodes/OCI/VectorStore/langchain/OracleDbVectorStore.js +239 -0
- package/dist/nodes/OCI/VectorStore/langchain/OracleDbVectorStore.js.map +1 -0
- package/dist/nodes/OCI/VectorStore/oracle.svg +3 -0
- package/dist/nodes/OCI/logWrapper.d.ts +21 -0
- package/dist/nodes/OCI/logWrapper.js +152 -0
- package/dist/nodes/OCI/logWrapper.js.map +1 -0
- package/dist/nodes/OCI/n8nDefaultFailedAttemptHandler.d.ts +1 -0
- package/dist/nodes/OCI/n8nDefaultFailedAttemptHandler.js +31 -0
- package/dist/nodes/OCI/n8nDefaultFailedAttemptHandler.js.map +1 -0
- package/dist/nodes/OCI/n8nLlmFailedAttemptHandler.d.ts +3 -0
- package/dist/nodes/OCI/n8nLlmFailedAttemptHandler.js +28 -0
- package/dist/nodes/OCI/n8nLlmFailedAttemptHandler.js.map +1 -0
- package/dist/nodes/OCI/processDocuments.d.ts +25 -0
- package/dist/nodes/OCI/processDocuments.js +30 -0
- package/dist/nodes/OCI/processDocuments.js.map +1 -0
- package/dist/nodes/OCI/utils.d.ts +1 -0
- package/dist/nodes/OCI/utils.js +25 -0
- package/dist/nodes/OCI/utils.js.map +1 -0
- package/dist/package.json +85 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +85 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Copyright 2022 n8n
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
4
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
5
|
+
the Software without restriction, including without limitation the rights to
|
|
6
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
7
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
8
|
+
so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
|
20
|
+
|
|
21
|
+
UNOFFICIAL ORACLE CLOUD INFRASTRUCTURE COMPATIBILITY NOTICE
|
|
22
|
+
|
|
23
|
+
This software is an independent project that provides compatibility with Oracle Cloud Infrastructure (OCI). It is not developed, endorsed, maintained, or supported by Oracle Corporation or any of its affiliates.
|
|
24
|
+
|
|
25
|
+
Oracle, Oracle Cloud, and Oracle Cloud Infrastructure (OCI) are trademarks or registered trademarks of Oracle Corporation and/or its affiliates. Any references to Oracle services or products are made solely for interoperability purposes.
|
|
26
|
+
|
|
27
|
+
Use of this software is at your own risk. It is provided "AS IS", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. Oracle Corporation assumes no responsibility or liability for any use of this software.
|
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# n8n-nodes-oracle-cloud
|
|
2
|
+
|
|
3
|
+
This is an n8n community node. It lets you use **Oracle Cloud Infrasctructure (OCI)** services in your n8n workflows.
|
|
4
|
+
|
|
5
|
+
## Disclaimer
|
|
6
|
+
|
|
7
|
+
This project is an **independent, community-driven** effort to enable compatibility with **Oracle Cloud Infrastructure (OCI)**. It is **not affiliated with, endorsed by, or supported by Oracle Corporation** in any way.
|
|
8
|
+
|
|
9
|
+
Oracle, Oracle Cloud, and Oracle Cloud Infrastructure (OCI) are trademarks or registered trademarks of Oracle and/or its affiliates. All references to Oracle services are for interoperability purposes only.
|
|
10
|
+
|
|
11
|
+
This software is provided **“as is,” without warranty** of any kind, express or implied. **Oracle assumes no responsibility or liability** for any issues arising from the use of this project.
|
|
12
|
+
|
|
13
|
+
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
|
|
14
|
+
|
|
15
|
+
[Installation](#installation)
|
|
16
|
+
[Operations](#operations)
|
|
17
|
+
[Resources](#resources)
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
|
|
22
|
+
|
|
23
|
+
## Operations
|
|
24
|
+
|
|
25
|
+
- Generative AI Services (Chat Model)
|
|
26
|
+
- Generative AI Services (Embedding)
|
|
27
|
+
- Oracle Database 23ai+ (Vector Store)
|
|
28
|
+
- AI Speech (Transcription)
|
|
29
|
+
|
|
30
|
+
## Resources
|
|
31
|
+
|
|
32
|
+
- [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
|
|
33
|
+
|
|
34
|
+
## Contribute
|
|
35
|
+
|
|
36
|
+
- [Github Repo](https://github.com/banumeow/n8n-nodes-oracle-cloud)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class OciApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
icon: {
|
|
7
|
+
readonly light: "file:icons/oracle.svg";
|
|
8
|
+
readonly dark: "file:icons/oracle.svg";
|
|
9
|
+
};
|
|
10
|
+
properties: INodeProperties[];
|
|
11
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OciApi = void 0;
|
|
4
|
+
const oci_common_1 = require("oci-common");
|
|
5
|
+
class OciApi {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.name = 'ociApi';
|
|
8
|
+
this.displayName = 'Oracle Cloud Infrastructure API';
|
|
9
|
+
this.documentationUrl = 'https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm';
|
|
10
|
+
this.icon = { light: 'file:icons/oracle.svg', dark: 'file:icons/oracle.svg' };
|
|
11
|
+
this.properties = [
|
|
12
|
+
{
|
|
13
|
+
displayName: 'User OCID',
|
|
14
|
+
name: 'userOcid',
|
|
15
|
+
type: 'string',
|
|
16
|
+
default: '',
|
|
17
|
+
placeholder: 'ocid1.user.oc1..xxxxxxxxxxxx',
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
displayName: 'Tenancy OCID',
|
|
22
|
+
name: 'tenancyOcid',
|
|
23
|
+
type: 'string',
|
|
24
|
+
default: '',
|
|
25
|
+
placeholder: 'ocid1.tenancy.oc1..xxxxxxxxxxxx',
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
displayName: 'Key Fingerprint',
|
|
30
|
+
name: 'keyFingerprint',
|
|
31
|
+
type: 'string',
|
|
32
|
+
typeOptions: { password: true },
|
|
33
|
+
default: '',
|
|
34
|
+
placeholder: 'xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx',
|
|
35
|
+
required: true,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
displayName: 'Region',
|
|
39
|
+
name: 'region',
|
|
40
|
+
type: 'options',
|
|
41
|
+
default: 'us-chicago-1',
|
|
42
|
+
options: oci_common_1.Region.values().map(region => ({
|
|
43
|
+
name: region.regionId,
|
|
44
|
+
value: region.regionId
|
|
45
|
+
})).sort((a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase())),
|
|
46
|
+
required: true,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
displayName: 'Private Key',
|
|
50
|
+
name: 'privateKey',
|
|
51
|
+
type: 'string',
|
|
52
|
+
typeOptions: {
|
|
53
|
+
password: true,
|
|
54
|
+
},
|
|
55
|
+
default: '',
|
|
56
|
+
placeholder: '-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----',
|
|
57
|
+
required: true,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
displayName: 'Private Key Passphrase',
|
|
61
|
+
name: 'passphrase',
|
|
62
|
+
type: 'string',
|
|
63
|
+
typeOptions: {
|
|
64
|
+
password: true,
|
|
65
|
+
},
|
|
66
|
+
default: '',
|
|
67
|
+
placeholder: '',
|
|
68
|
+
required: false,
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.OciApi = OciApi;
|
|
74
|
+
//# sourceMappingURL=OciApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OciApi.credentials.js","sourceRoot":"","sources":["../../credentials/OciApi.credentials.ts"],"names":[],"mappings":";;;AAMC,2CAAoC;AAGrC,MAAa,MAAM;IAAnB;QACC,SAAI,GAAG,QAAQ,CAAC;QAEhB,gBAAW,GAAG,iCAAiC,CAAC;QAEhD,qBAAgB,GAAG,2EAA2E,CAAC;QAE/F,SAAI,GAAG,EAAE,KAAK,EAAE,uBAAuB,EAAE,IAAI,EAAE,uBAAuB,EAAW,CAAC;QAElF,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,8BAA8B;gBAC3C,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,cAAc;gBAC3B,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,iCAAiC;gBAC9C,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,iBAAiB;gBAC9B,IAAI,EAAE,gB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entialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
icon: {
|
|
7
|
+
readonly light: "file:icons/oracle.svg";
|
|
8
|
+
readonly dark: "file:icons/oracle.svg";
|
|
9
|
+
};
|
|
10
|
+
properties: INodeProperties[];
|
|
11
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OracleDatabaseApi = void 0;
|
|
4
|
+
class OracleDatabaseApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'oracleDatabaseApi';
|
|
7
|
+
this.displayName = 'Oracle Database API';
|
|
8
|
+
this.documentationUrl = 'https://docs.oracle.com/en-us/iaas/autonomous-database-serverless/doc/connect-jdbc-thin-tls.html';
|
|
9
|
+
this.icon = { light: 'file:icons/oracle.svg', dark: 'file:icons/oracle.svg' };
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'User',
|
|
13
|
+
name: 'user',
|
|
14
|
+
type: 'string',
|
|
15
|
+
default: '',
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
displayName: 'Password',
|
|
20
|
+
name: 'password',
|
|
21
|
+
type: 'string',
|
|
22
|
+
typeOptions: { password: true },
|
|
23
|
+
default: '',
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
displayName: 'Is autonomous database?',
|
|
28
|
+
name: 'isAutonomous',
|
|
29
|
+
type: 'boolean',
|
|
30
|
+
default: false
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
displayName: 'Host',
|
|
34
|
+
name: 'host',
|
|
35
|
+
type: 'string',
|
|
36
|
+
default: '',
|
|
37
|
+
required: true,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
displayName: 'Port',
|
|
41
|
+
name: 'port',
|
|
42
|
+
type: 'number',
|
|
43
|
+
default: '',
|
|
44
|
+
required: true,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
displayName: 'Service Name',
|
|
48
|
+
name: 'serviceName',
|
|
49
|
+
type: 'string',
|
|
50
|
+
default: '',
|
|
51
|
+
required: true,
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.OracleDatabaseApi = OracleDatabaseApi;
|
|
57
|
+
//# sourceMappingURL=OracleDatabaseApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OracleDatabaseApi.credentials.js","sourceRoot":"","sources":["../../credentials/OracleDatabaseApi.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,iBAAiB;IAA9B;QACC,SAAI,GAAG,mBAAmB,CAAC;QAE3B,gBAAW,GAAG,qBAAqB,CAAC;QAEpC,qBAAgB,GAAG,kGAAkG,CAAC;QAEtH,SAAI,GAAG,EAAE,KAAK,EAAE,uBAAuB,EAAE,IAAI,EAAE,uBAAuB,EAAW,CAAC;QAElF,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,MAAM;gBACnB,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,yBAAyB;gBACtC,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK;aACd;YAED;gBACC,WAAW,EAAE,MAAM;gBACnB,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,MAAM;gBACnB,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,cAAc;gBAC3B,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;aACd;SACD,CAAC;IACH,CAAC;CAAA;AAtDD,8CAsDC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type INodeType, type INodeTypeDescription, type SupplyData, type ISupplyDataFunctions, type ILoadOptionsFunctions, type INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
+
export declare class EmbeddingsOciGenerativeAi implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
methods: {
|
|
5
|
+
loadOptions: {
|
|
6
|
+
getModels(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EmbeddingsOciGenerativeAi = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const oci_common_1 = require("oci-common");
|
|
6
|
+
const oci_generativeai_1 = require("oci-generativeai");
|
|
7
|
+
const OciEmbedings_1 = require("./langchain/OciEmbedings");
|
|
8
|
+
const logWrapper_1 = require("../logWrapper");
|
|
9
|
+
const utils_1 = require("../utils");
|
|
10
|
+
class EmbeddingsOciGenerativeAi {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.description = {
|
|
13
|
+
displayName: 'Embeddings OCI Generative AI',
|
|
14
|
+
name: 'embeddingsOciGenerativeAi',
|
|
15
|
+
icon: { light: 'file:oracle.svg', dark: 'file:oracle.svg' },
|
|
16
|
+
credentials: [
|
|
17
|
+
{
|
|
18
|
+
name: 'ociApi',
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
group: ['transform'],
|
|
23
|
+
version: [1, 1.1, 1.2, 2],
|
|
24
|
+
description: 'Use OCI Generative AI Embeddings',
|
|
25
|
+
defaults: {
|
|
26
|
+
name: 'Embeddings OCI Generative AI',
|
|
27
|
+
},
|
|
28
|
+
codex: {
|
|
29
|
+
categories: ['AI'],
|
|
30
|
+
subcategories: {
|
|
31
|
+
AI: ['Embeddings'],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
inputs: [],
|
|
35
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.AiEmbedding],
|
|
36
|
+
outputNames: ['Embeddings'],
|
|
37
|
+
properties: [
|
|
38
|
+
{
|
|
39
|
+
displayName: 'Compartment ID',
|
|
40
|
+
name: 'compartmentId',
|
|
41
|
+
type: 'string',
|
|
42
|
+
default: '',
|
|
43
|
+
placeholder: 'ocid1.compartment.oc1..aaaaaaaa3x7n7wwfnghe4imvt3niwo76wgqv6ecn2iadiwoph73jjowbhbna',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
displayName: 'On Demand Model Name or ID',
|
|
47
|
+
name: 'model',
|
|
48
|
+
type: 'options',
|
|
49
|
+
typeOptions: {
|
|
50
|
+
loadOptionsMethod: 'getModels',
|
|
51
|
+
},
|
|
52
|
+
default: '',
|
|
53
|
+
description: 'Select a On Demand Model from OCI Generative AI Services. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
54
|
+
required: true,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
};
|
|
58
|
+
this.methods = {
|
|
59
|
+
loadOptions: {
|
|
60
|
+
async getModels() {
|
|
61
|
+
const credentials = await this.getCredentials('ociApi');
|
|
62
|
+
let privateKey = credentials.privateKey;
|
|
63
|
+
privateKey = (0, utils_1.privateKeyParse)(privateKey);
|
|
64
|
+
credentials.privateKey = privateKey;
|
|
65
|
+
const tenancyId = credentials.tenancyOcid;
|
|
66
|
+
const client = new oci_generativeai_1.GenerativeAiClient({
|
|
67
|
+
authenticationDetailsProvider: new oci_common_1.SimpleAuthenticationDetailsProvider(tenancyId, credentials.userOcid, credentials.keyFingerprint, credentials.privateKey, credentials.passphrase, oci_common_1.Region.fromRegionId(credentials.region)),
|
|
68
|
+
});
|
|
69
|
+
const compartmentId = this.getNodeParameter('compartmentId', 0) || tenancyId;
|
|
70
|
+
const listModels = await client.listModels({ compartmentId: compartmentId });
|
|
71
|
+
const options = listModels.modelCollection.items
|
|
72
|
+
.filter((modelSummary) => modelSummary.capabilities.includes(oci_generativeai_1.models.ModelSummary.Capabilities.TextEmbeddings))
|
|
73
|
+
.map((modelSummary) => {
|
|
74
|
+
return {
|
|
75
|
+
name: modelSummary.displayName,
|
|
76
|
+
value: modelSummary.displayName,
|
|
77
|
+
};
|
|
78
|
+
})
|
|
79
|
+
.sort((a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase()));
|
|
80
|
+
return [...new Set(options)];
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
async supplyData(itemIndex) {
|
|
86
|
+
const credentials = await this.getCredentials('ociApi');
|
|
87
|
+
let privateKey = credentials.privateKey;
|
|
88
|
+
privateKey = (0, utils_1.privateKeyParse)(privateKey);
|
|
89
|
+
credentials.privateKey = privateKey;
|
|
90
|
+
const modelName = this.getNodeParameter('model', itemIndex);
|
|
91
|
+
const compartmentId = this.getNodeParameter('compartmentId', itemIndex);
|
|
92
|
+
const embeddings = new OciEmbedings_1.OciEmbeddings({
|
|
93
|
+
model: modelName,
|
|
94
|
+
compartmentId: compartmentId || credentials.tenancyOcid,
|
|
95
|
+
auth: {
|
|
96
|
+
authProvider: new oci_common_1.SimpleAuthenticationDetailsProvider(credentials.tenancyOcid, credentials.userOcid, credentials.keyFingerprint, credentials.privateKey, credentials.passphrase, oci_common_1.Region.fromRegionId(credentials.region)),
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
return {
|
|
100
|
+
response: (0, logWrapper_1.logWrapper)(embeddings, this),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.EmbeddingsOciGenerativeAi = EmbeddingsOciGenerativeAi;
|
|
105
|
+
//# sourceMappingURL=EmbeddingsOciGenerativeAi.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmbeddingsOciGenerativeAi.node.js","sourceRoot":"","sources":["../../../../nodes/OCI/GenerativeAI/EmbeddingsOciGenerativeAi.node.ts"],"names":[],"mappings":";;;AAAA,+CAQsB;AAEtB,2CAAyE;AACzE,uDAA8D;AAC9D,2DAAyD;AAEzD,8CAA2C;AAE3C,oCAA0C;AAE1C,MAAa,yBAAyB;IAAtC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,8BAA8B;YAC3C,IAAI,EAAE,2BAA2B;YACjC,IAAI,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,iBAAiB,EAAE;YAC3D,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;YACzB,WAAW,EAAE,kCAAkC;YAC/C,QAAQ,EAAE;gBACT,IAAI,EAAE,8BAA8B;aACpC;YAED,KAAK,EAAE;gBACN,UAAU,EAAE,CAAC,IAAI,CAAC;gBAClB,aAAa,EAAE;oBACd,EAAE,EAAE,CAAC,YAAY,CAAC;iBAClB;aACD;YAED,MAAM,EAAE,EAAE;YAEV,OAAO,EAAE,CAAC,kCAAmB,C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AY,EAAE,IAAI,gDAAmC,CACpD,WAAW,CAAC,WAAqB,EACjC,WAAW,CAAC,QAAkB,EAC9B,WAAW,CAAC,cAAwB,EACpC,WAAW,CAAC,UAAoB,EAChC,WAAW,CAAC,UAAoB,EAChC,mBAAM,CAAC,YAAY,CAAC,WAAW,CAAC,MAAgB,CAAC,CACjD;aACD;SACD,CAAC,CAAC;QAEH,OAAO;YACN,QAAQ,EAAE,IAAA,uBAAU,EAAC,UAAU,EAAE,IAAI,CAAC;SACtC,CAAC;IACH,CAAC;CACD;AAlHD,8DAkHC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type INodeType, type INodeTypeDescription, type INodePropertyOptions, type ISupplyDataFunctions, type ILoadOptionsFunctions, type SupplyData } from 'n8n-workflow';
|
|
2
|
+
export declare class LmChatOciGenerativeAi implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
methods: {
|
|
5
|
+
loadOptions: {
|
|
6
|
+
getModels(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LmChatOciGenerativeAi = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const ChatOci_1 = require("./langchain/ChatOci");
|
|
6
|
+
const oci_common_1 = require("oci-common");
|
|
7
|
+
const n8nLlmFailedAttemptHandler_1 = require("../n8nLlmFailedAttemptHandler");
|
|
8
|
+
const N8nLlmTracing_1 = require("../N8nLlmTracing");
|
|
9
|
+
const oci_generativeai_1 = require("oci-generativeai");
|
|
10
|
+
const utils_1 = require("../utils");
|
|
11
|
+
class LmChatOciGenerativeAi {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.description = {
|
|
14
|
+
displayName: 'OCI Generative AI Chat Model',
|
|
15
|
+
name: 'lmChatOciGenerativeAi',
|
|
16
|
+
group: ['transform'],
|
|
17
|
+
icon: { light: 'file:oracle.svg', dark: 'file:oracle.svg' },
|
|
18
|
+
version: [1, 1.1, 2],
|
|
19
|
+
description: 'Call OCI Generative AI Services for Oracle Cloud',
|
|
20
|
+
defaults: {
|
|
21
|
+
name: 'OCI Generative AI Chat Model',
|
|
22
|
+
},
|
|
23
|
+
credentials: [
|
|
24
|
+
{
|
|
25
|
+
name: 'ociApi',
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
codex: {
|
|
30
|
+
categories: ['AI'],
|
|
31
|
+
subcategories: {
|
|
32
|
+
AI: ['Language Models', 'Root Nodes'],
|
|
33
|
+
'Language Models': ['Text Completion Models'],
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
inputs: [],
|
|
37
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.AiLanguageModel],
|
|
38
|
+
outputNames: ['Model'],
|
|
39
|
+
properties: [
|
|
40
|
+
{
|
|
41
|
+
displayName: 'Compartment ID',
|
|
42
|
+
name: 'compartmentId',
|
|
43
|
+
type: 'string',
|
|
44
|
+
default: '',
|
|
45
|
+
placeholder: 'ocid1.compartment.oc1..aaaaaaaa3x7n7wwfnghe4imvt3niwo76wgqv6ecn2iadiwoph73jjowbhbna',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
displayName: 'On Demand Model Name or ID',
|
|
49
|
+
name: 'model',
|
|
50
|
+
type: 'options',
|
|
51
|
+
typeOptions: {
|
|
52
|
+
loadOptionsMethod: 'getModels',
|
|
53
|
+
},
|
|
54
|
+
default: '',
|
|
55
|
+
description: 'Select a On Demand Model from OCI Generative AI Services. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
56
|
+
required: true,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
displayName: 'Options',
|
|
60
|
+
name: 'options',
|
|
61
|
+
placeholder: 'Add Option',
|
|
62
|
+
description: 'Additional options to add',
|
|
63
|
+
type: 'collection',
|
|
64
|
+
default: {},
|
|
65
|
+
options: [
|
|
66
|
+
{
|
|
67
|
+
displayName: 'Temperature',
|
|
68
|
+
name: 'temperature',
|
|
69
|
+
default: 0.2,
|
|
70
|
+
typeOptions: { maxValue: 1, minValue: 0, numberPrecision: 1 },
|
|
71
|
+
description: 'Controls the randomness of the generated text. Lower values make the output more focused and deterministic, while higher values make it more diverse and random.',
|
|
72
|
+
type: 'number',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
displayName: 'Top P',
|
|
76
|
+
name: 'topP',
|
|
77
|
+
default: 1,
|
|
78
|
+
typeOptions: { maxValue: 1, minValue: 0, numberPrecision: 1 },
|
|
79
|
+
description: 'Chooses from the smallest possible set of tokens whose cumulative probability exceeds the probability top_p. Helps generate more human-like text by reducing repetitions.',
|
|
80
|
+
type: 'number',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
displayName: 'Top K',
|
|
84
|
+
name: 'topK',
|
|
85
|
+
default: -1,
|
|
86
|
+
typeOptions: { maxValue: 500, minValue: -1, numberPrecision: 1 },
|
|
87
|
+
description: 'Limits the number of highest probability vocabulary tokens to consider at each step. A higher value increases diversity but may reduce coherence. Set to -1 to disable.',
|
|
88
|
+
type: 'number',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
displayName: 'Frequency Penalty',
|
|
92
|
+
name: 'frequencyPenalty',
|
|
93
|
+
type: 'number',
|
|
94
|
+
default: 0.0,
|
|
95
|
+
typeOptions: { maxValue: 1, minValue: 0 },
|
|
96
|
+
description: 'Adjusts the penalty for tokens that have already appeared in the generated text. Higher values discourage repetition.',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
displayName: 'Presence Penalty',
|
|
100
|
+
name: 'presencePenalty',
|
|
101
|
+
type: 'number',
|
|
102
|
+
default: 0.0,
|
|
103
|
+
description: 'Adjusts the penalty for tokens based on their presence in the generated text so far. Positive values penalize tokens that have already appeared, encouraging diversity.',
|
|
104
|
+
},
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
};
|
|
109
|
+
this.methods = {
|
|
110
|
+
loadOptions: {
|
|
111
|
+
async getModels() {
|
|
112
|
+
const credentials = await this.getCredentials('ociApi');
|
|
113
|
+
let privateKey = credentials.privateKey;
|
|
114
|
+
privateKey = (0, utils_1.privateKeyParse)(privateKey);
|
|
115
|
+
credentials.privateKey = privateKey;
|
|
116
|
+
const tenancyId = credentials.tenancyOcid;
|
|
117
|
+
const client = new oci_generativeai_1.GenerativeAiClient({
|
|
118
|
+
authenticationDetailsProvider: new oci_common_1.SimpleAuthenticationDetailsProvider(tenancyId, credentials.userOcid, credentials.keyFingerprint, credentials.privateKey, credentials.passphrase, oci_common_1.Region.fromRegionId(credentials.region)),
|
|
119
|
+
});
|
|
120
|
+
const compartmentId = this.getNodeParameter('compartmentId', 0) || tenancyId;
|
|
121
|
+
const listModels = await client.listModels({ compartmentId: compartmentId });
|
|
122
|
+
const options = listModels.modelCollection.items
|
|
123
|
+
.filter((modelSummary) => modelSummary.capabilities.includes(oci_generativeai_1.models.ModelSummary.Capabilities.Chat))
|
|
124
|
+
.map((modelSummary) => {
|
|
125
|
+
return {
|
|
126
|
+
name: modelSummary.displayName,
|
|
127
|
+
value: modelSummary.displayName,
|
|
128
|
+
};
|
|
129
|
+
})
|
|
130
|
+
.sort((a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase()));
|
|
131
|
+
return [...new Set(options)];
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
async supplyData(itemIndex) {
|
|
137
|
+
try {
|
|
138
|
+
const credentials = await this.getCredentials('ociApi');
|
|
139
|
+
let privateKey = credentials.privateKey;
|
|
140
|
+
privateKey = (0, utils_1.privateKeyParse)(privateKey);
|
|
141
|
+
credentials.privateKey = privateKey;
|
|
142
|
+
const modelName = this.getNodeParameter('model', itemIndex);
|
|
143
|
+
const compartmentId = this.getNodeParameter('compartmentId', itemIndex);
|
|
144
|
+
const options = this.getNodeParameter('options', itemIndex, {});
|
|
145
|
+
const model = new ChatOci_1.ChatOciGenerativeAi({
|
|
146
|
+
model: modelName,
|
|
147
|
+
compartmentId: compartmentId || credentials.tenancyOcid,
|
|
148
|
+
auth: {
|
|
149
|
+
authProvider: new oci_common_1.SimpleAuthenticationDetailsProvider(credentials.tenancyOcid, credentials.userOcid, credentials.keyFingerprint, credentials.privateKey, credentials.passphrase, oci_common_1.Region.fromRegionId(credentials.region)),
|
|
150
|
+
},
|
|
151
|
+
...options,
|
|
152
|
+
callbacks: [new N8nLlmTracing_1.N8nLlmTracing(this)],
|
|
153
|
+
onFailedAttempt: (0, n8nLlmFailedAttemptHandler_1.makeN8nLlmFailedAttemptHandler)(this),
|
|
154
|
+
});
|
|
155
|
+
return {
|
|
156
|
+
response: model,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
this.logger.error(`Error in LmChatOciCohere.supplyData: ${error.message}`, error);
|
|
161
|
+
if (error instanceof n8n_workflow_1.NodeOperationError) {
|
|
162
|
+
throw error;
|
|
163
|
+
}
|
|
164
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { message: error.message });
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
exports.LmChatOciGenerativeAi = LmChatOciGenerativeAi;
|
|
169
|
+
//# sourceMappingURL=LmChatOciGenerativeAi.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LmChatOciGenerativeAi.node.js","sourceRoot":"","sources":["../../../../nodes/OCI/GenerativeAI/LmChatOciGenerativeAi.node.ts"],"names":[],"mappings":";;;AAAA,+CASsB;AACtB,iDAA0D;AAC1D,2CAAyE;AACzE,8EAA+E;AAC/E,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AAC;aACrD,CAAC,CAAC;YAEH,OAAO;gBACN,QAAQ,EAAE,KAAK;aACf,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,wCAAwC,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,CAAC;YAElF,IAAI,KAAK,YAAY,iCAAkB,EAAE,CAAC;gBACzC,MAAM,KAAK,CAAC;YACb,CAAC;YAED,MAAM,IAAI,iCAAkB,CAC3B,IAAI,CAAC,OAAO,EAAE,EACd,KAAK,EACL,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAC1B,CAAC;QACH,CAAC;IAEF,CAAC;CACD;AApMD,sDAoMC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { BaseChatModel, type BaseChatModelParams } from '@langchain/core/language_models/chat_models';
|
|
2
|
+
import { BaseMessage } from '@langchain/core/messages';
|
|
3
|
+
import { ChatResult } from '@langchain/core/outputs';
|
|
4
|
+
import { CallbackManagerForLLMRun } from '@langchain/core/callbacks/manager';
|
|
5
|
+
import { GenerativeAiInferenceClient } from 'oci-generativeaiinference';
|
|
6
|
+
import { AuthenticationDetailsProvider } from 'oci-common';
|
|
7
|
+
import { type RunnableToolLike } from '@langchain/core/runnables';
|
|
8
|
+
import { StructuredToolInterface } from '@langchain/core/tools';
|
|
9
|
+
import * as model from 'oci-generativeaiinference/lib/model';
|
|
10
|
+
export interface OciGenerativeAiInput extends BaseChatModelParams {
|
|
11
|
+
model: string;
|
|
12
|
+
compartmentId: string;
|
|
13
|
+
auth: {
|
|
14
|
+
authProvider: AuthenticationDetailsProvider;
|
|
15
|
+
};
|
|
16
|
+
temperature?: number;
|
|
17
|
+
topP?: number;
|
|
18
|
+
topK?: number;
|
|
19
|
+
frequencyPenalty?: number;
|
|
20
|
+
presencePenalty?: number;
|
|
21
|
+
tools?: (model.ToolDefinition | model.CohereTool)[];
|
|
22
|
+
}
|
|
23
|
+
export declare class ChatOciGenerativeAi extends BaseChatModel {
|
|
24
|
+
model: string;
|
|
25
|
+
compartmentId: string;
|
|
26
|
+
auth: {
|
|
27
|
+
authProvider: AuthenticationDetailsProvider;
|
|
28
|
+
};
|
|
29
|
+
temperature?: number;
|
|
30
|
+
topP?: number;
|
|
31
|
+
topK?: number;
|
|
32
|
+
client: GenerativeAiInferenceClient;
|
|
33
|
+
frequencyPenalty?: number;
|
|
34
|
+
presencePenalty?: number;
|
|
35
|
+
tools?: (model.ToolDefinition | model.CohereTool)[];
|
|
36
|
+
constructor(fields: OciGenerativeAiInput);
|
|
37
|
+
_llmType(): string;
|
|
38
|
+
bindTools(tools: (StructuredToolInterface | Record<string, any> | RunnableToolLike)[]): this;
|
|
39
|
+
_generate(messages: BaseMessage[], options: this['ParsedCallOptions'], runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;
|
|
40
|
+
}
|