@qvac/sdk 0.8.2 → 0.8.3
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
CHANGED
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
|
|
15
15
|
See [https://docs.qvac.tether.io/sdk/getting-started](https://docs.qvac.tether.io/sdk/getting-started) for the comprehensive QVAC documentation.
|
|
16
16
|
|
|
17
|
+
For AI/LLM tools, use [https://docs.qvac.tether.io/llms-full.txt](https://docs.qvac.tether.io/llms-full.txt) as the consolidated plaintext documentation export.
|
|
18
|
+
|
|
17
19
|
## Supported environments and installation
|
|
18
20
|
|
|
19
21
|
See https://docs.qvac.tether.io/sdk/getting-started/installation
|
|
@@ -3,4 +3,5 @@ export declare function logCacheInit(cacheKey: string, systemPrompt: string, too
|
|
|
3
3
|
export declare function logMessagesToAddon(messages: unknown[], phase?: "CACHE_INIT" | "PROMPT_SEND" | "NO_CACHE"): void;
|
|
4
4
|
export declare function logCacheDisabled(): void;
|
|
5
5
|
export declare function logCacheSave(sessionPath: string): void;
|
|
6
|
+
export declare function logCacheSaveError(sessionPath: string, err: unknown): void;
|
|
6
7
|
//# sourceMappingURL=cache-logger.d.ts.map
|
|
@@ -32,3 +32,6 @@ export function logCacheDisabled() {
|
|
|
32
32
|
export function logCacheSave(sessionPath) {
|
|
33
33
|
logger.debug(`[kv-cache] Saving session: ...${sessionPath.slice(-20)}`);
|
|
34
34
|
}
|
|
35
|
+
export function logCacheSaveError(sessionPath, err) {
|
|
36
|
+
logger.warn(`[kv-cache] Failed to save session: ...${sessionPath.slice(-20)} — ${err instanceof Error ? err.message : String(err)}`);
|
|
37
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { logCacheDisabled, logCacheInit, logCacheSave, logCacheStatus, logMessagesToAddon, } from "./cache-logger.js";
|
|
1
|
+
import { logCacheDisabled, logCacheInit, logCacheSave, logCacheSaveError, logCacheStatus, logMessagesToAddon, } from "./cache-logger.js";
|
|
2
2
|
import { customCacheExists, extractSystemPrompt, findMatchingCache, generateConfigHash, getCacheFilePath, getCurrentCacheInfo, markCacheInitialized, renameCacheFile, } from "../../../ops/kv-cache-utils.js";
|
|
3
3
|
import { getModel, getModelConfig, } from "../../../registry/model-registry.js";
|
|
4
4
|
import { checkForToolEvents, insertToolsIntoHistory, setupToolGrammar, } from "../../../../utils/tool-integration.js";
|
|
@@ -104,8 +104,18 @@ async function* processModelResponse(model, messagesToSend, shouldSaveCache, too
|
|
|
104
104
|
const sessionMsg = messagesToSend.find((m) => m.role === "session");
|
|
105
105
|
if (sessionMsg?.content) {
|
|
106
106
|
logCacheSave(sessionMsg.content);
|
|
107
|
+
const cachePath = sessionMsg.content;
|
|
108
|
+
const saveResp = await model.run([
|
|
109
|
+
{ role: "session", content: cachePath },
|
|
110
|
+
{ role: "session", content: "save" },
|
|
111
|
+
]);
|
|
112
|
+
try {
|
|
113
|
+
await saveResp.await();
|
|
114
|
+
}
|
|
115
|
+
catch (err) {
|
|
116
|
+
logCacheSaveError(cachePath, err);
|
|
117
|
+
}
|
|
107
118
|
}
|
|
108
|
-
await model.run([{ role: "session", content: "save" }]);
|
|
109
119
|
}
|
|
110
120
|
const responseWithStats = response;
|
|
111
121
|
const stats = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qvac/sdk",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,6 +9,51 @@
|
|
|
9
9
|
},
|
|
10
10
|
"bugs": "https://github.com/tetherto/qvac/issues",
|
|
11
11
|
"homepage": "https://github.com/tetherto/qvac/tree/main/packages/sdk#readme",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"ai",
|
|
14
|
+
"bare",
|
|
15
|
+
"cross-platform",
|
|
16
|
+
"deep-learning",
|
|
17
|
+
"diffusion",
|
|
18
|
+
"edge-ai",
|
|
19
|
+
"embeddings",
|
|
20
|
+
"expo",
|
|
21
|
+
"gguf",
|
|
22
|
+
"gpu",
|
|
23
|
+
"holepunch",
|
|
24
|
+
"hyperswarm",
|
|
25
|
+
"image-generation",
|
|
26
|
+
"inference",
|
|
27
|
+
"large-language-model",
|
|
28
|
+
"llama-cpp",
|
|
29
|
+
"llm",
|
|
30
|
+
"local",
|
|
31
|
+
"local-ai",
|
|
32
|
+
"machine-learning",
|
|
33
|
+
"ml",
|
|
34
|
+
"model-registry",
|
|
35
|
+
"node",
|
|
36
|
+
"ocr",
|
|
37
|
+
"offline",
|
|
38
|
+
"on-device",
|
|
39
|
+
"p2p",
|
|
40
|
+
"peer-to-peer",
|
|
41
|
+
"private-ai",
|
|
42
|
+
"qvac",
|
|
43
|
+
"rag",
|
|
44
|
+
"react-native",
|
|
45
|
+
"sdk",
|
|
46
|
+
"self-hosted",
|
|
47
|
+
"speech-to-text",
|
|
48
|
+
"stt",
|
|
49
|
+
"tether",
|
|
50
|
+
"text-to-speech",
|
|
51
|
+
"transcription",
|
|
52
|
+
"translation",
|
|
53
|
+
"tts",
|
|
54
|
+
"typescript",
|
|
55
|
+
"whisper"
|
|
56
|
+
],
|
|
12
57
|
"type": "module",
|
|
13
58
|
"main": "./dist/index.js",
|
|
14
59
|
"types": "./dist/index.d.ts",
|