@tmlmobilidade/ai 20260506.0.29 → 20260506.4.20
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/oci-generativeai.js +15 -15
- package/package.json +1 -1
package/dist/oci-generativeai.js
CHANGED
|
@@ -13,23 +13,23 @@ export class OCIGenerativeAIProvider {
|
|
|
13
13
|
ociClient;
|
|
14
14
|
constructor() {
|
|
15
15
|
// Validate that all required environment variables are set
|
|
16
|
-
if (!process.env.
|
|
17
|
-
throw new Error('Missing
|
|
18
|
-
if (!process.env.
|
|
19
|
-
throw new Error('Missing
|
|
20
|
-
if (!process.env.
|
|
21
|
-
throw new Error('Missing
|
|
22
|
-
if (!process.env.
|
|
23
|
-
throw new Error('Missing
|
|
24
|
-
if (!process.env.
|
|
25
|
-
throw new Error('Missing
|
|
26
|
-
if (!process.env.
|
|
27
|
-
throw new Error('Missing
|
|
16
|
+
if (!process.env.OCI_AI_FINGERPRINT)
|
|
17
|
+
throw new Error('Missing OCI_AI_FINGERPRINT environment variable for OCI Generative AI Provider');
|
|
18
|
+
if (!process.env.OCI_AI_PRIVATE_KEY_PATH && !process.env.OCI_AI_PRIVATE_KEY)
|
|
19
|
+
throw new Error('Missing OCI_AI_PRIVATE_KEY_PATH or OCI_AI_PRIVATE_KEY environment variable for OCI Generative AI Provider');
|
|
20
|
+
if (!process.env.OCI_AI_REGION)
|
|
21
|
+
throw new Error('Missing OCI_AI_REGION environment variable for OCI Generative AI Provider');
|
|
22
|
+
if (!process.env.OCI_AI_TENANCY)
|
|
23
|
+
throw new Error('Missing OCI_AI_TENANCY environment variable for OCI Generative AI Provider');
|
|
24
|
+
if (!process.env.OCI_AI_USER)
|
|
25
|
+
throw new Error('Missing OCI_AI_USER environment variable for OCI Generative AI Provider');
|
|
26
|
+
if (!process.env.OCI_AI_COMPARTMENT)
|
|
27
|
+
throw new Error('Missing OCI_AI_COMPARTMENT environment variable for OCI Generative AI Provider');
|
|
28
28
|
// Build the OCI client using the environment variables for authentication
|
|
29
29
|
this.ociClient = new GenerativeAiInferenceClient({
|
|
30
|
-
authenticationDetailsProvider: new SimpleAuthenticationDetailsProvider(process.env.
|
|
30
|
+
authenticationDetailsProvider: new SimpleAuthenticationDetailsProvider(process.env.OCI_AI_TENANCY, process.env.OCI_AI_USER, process.env.OCI_AI_FINGERPRINT, process.env.OCI_AI_PRIVATE_KEY_PATH ? readFileSync(process.env.OCI_AI_PRIVATE_KEY_PATH, 'utf8') : process.env.OCI_AI_PRIVATE_KEY, null, Region.fromRegionId(process.env.OCI_AI_REGION)),
|
|
31
31
|
});
|
|
32
|
-
this.ociClient.endpoint = `https://inference.generativeai.${process.env.
|
|
32
|
+
this.ociClient.endpoint = `https://inference.generativeai.${process.env.OCI_AI_REGION}.oci.oraclecloud.com`;
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Runs a prompt through the OCI Generative AI service and returns the response.
|
|
@@ -69,7 +69,7 @@ export class OCIGenerativeAIProvider {
|
|
|
69
69
|
topK: 0,
|
|
70
70
|
topP: 1,
|
|
71
71
|
},
|
|
72
|
-
compartmentId: process.env.
|
|
72
|
+
compartmentId: process.env.OCI_AI_COMPARTMENT,
|
|
73
73
|
servingMode: {
|
|
74
74
|
modelId: this.modelOCID,
|
|
75
75
|
servingType: 'ON_DEMAND',
|