@novaqore/ai 0.1.0 → 0.2.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/README.md +2 -2
- package/index.js +8 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<a href="https://www.npmjs.com/package/@novaqore/ai"><img src="https://img.shields.io/npm/v/@novaqore/ai?color=blue&label=npm" alt="npm version" /></a>
|
|
11
11
|
<a href="https://github.com/novaqore/ai/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="license" /></a>
|
|
12
12
|
<a href="https://img.shields.io/node/v/@novaqore/ai"><img src="https://img.shields.io/node/v/@novaqore/ai?color=brightgreen" alt="node version" /></a>
|
|
13
|
-
<a href="https://discord.gg/
|
|
13
|
+
<a href="https://discord.gg/JAzgcf6r"><img src="https://img.shields.io/discord/1234567890?color=5865F2&label=discord&logo=discord&logoColor=white" alt="Discord" /></a>
|
|
14
14
|
<br><br>
|
|
15
15
|
<a href="https://novaqore.ai/developer"><strong>🔑 Get Your Quantum Keys</strong></a> |
|
|
16
16
|
<a href="https://novaqore.ai"><strong>🌐 Website</strong></a> |
|
|
@@ -272,7 +272,7 @@ Technical deep dives into the cryptography, architecture, and threat models behi
|
|
|
272
272
|
We are building this in the open. Join us.
|
|
273
273
|
|
|
274
274
|
<p>
|
|
275
|
-
<a href="https://discord.gg/
|
|
275
|
+
<a href="https://discord.gg/JAzgcf6r"><strong>Discord</strong></a> |
|
|
276
276
|
<a href="https://x.com/novaqore"><strong>X (Twitter)</strong></a> |
|
|
277
277
|
<a href="https://tiktok.com/@novaqore"><strong>TikTok</strong></a> |
|
|
278
278
|
<a href="https://youtube.com/@novaqore"><strong>YouTube</strong></a>
|
package/index.js
CHANGED
|
@@ -10,6 +10,7 @@ class NovaQoreAI {
|
|
|
10
10
|
#uid;
|
|
11
11
|
#quantumKey;
|
|
12
12
|
#keyId;
|
|
13
|
+
#bearerToken;
|
|
13
14
|
|
|
14
15
|
constructor(config) {
|
|
15
16
|
if (config === undefined) {
|
|
@@ -45,6 +46,7 @@ class NovaQoreAI {
|
|
|
45
46
|
this.#uid = config.uid;
|
|
46
47
|
this.#quantumKey = config.quantumKey;
|
|
47
48
|
this.#keyId = config.keyId;
|
|
49
|
+
this.#bearerToken = config.bearerToken || null;
|
|
48
50
|
this.version = version;
|
|
49
51
|
this.description = "NovaQore AI - Quantum-encrypted LLM client by NovaQore";
|
|
50
52
|
this.methods = ["chat", "health"];
|
|
@@ -97,9 +99,14 @@ class NovaQoreAI {
|
|
|
97
99
|
|
|
98
100
|
const { ciphertext, encrypted, sharedSecret } = await this.#encryptPayload(payload);
|
|
99
101
|
|
|
102
|
+
const headers = { "Content-Type": "application/json" };
|
|
103
|
+
if (this.#bearerToken) {
|
|
104
|
+
headers["Authorization"] = `Bearer ${this.#bearerToken}`;
|
|
105
|
+
}
|
|
106
|
+
|
|
100
107
|
const res = await fetch(`${BASE_URL}/v1/chat/completions`, {
|
|
101
108
|
method: "POST",
|
|
102
|
-
headers
|
|
109
|
+
headers,
|
|
103
110
|
body: JSON.stringify({
|
|
104
111
|
uid: this.#uid,
|
|
105
112
|
keyId: this.#keyId,
|
package/package.json
CHANGED