@veracity/ai 0.0.14 → 0.0.16
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/Markdown/index.d.ts +2 -1
- package/dist/Markdown/index.d.ts.map +1 -1
- package/dist/components/AIChat/index.d.ts +2 -0
- package/dist/components/AIChat/index.d.ts.map +1 -1
- package/dist/components/AIChatAgentMessage.d.ts.map +1 -1
- package/dist/components/ToolCallComponent/index.d.ts.map +1 -1
- package/dist/veracity-ai.es.js +16 -12
- package/dist/veracity-ai.umd.js +7 -7
- package/package.json +1 -1
package/dist/Markdown/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { Extension } from "mdast-util-from-markdown";
|
|
1
2
|
import { PyodideInterface } from "pyodide";
|
|
2
|
-
export declare function setElementMarkdown(element: HTMLElement, markdown: string, pyodide: PyodideInterface): void;
|
|
3
|
+
export declare function setElementMarkdown(element: HTMLElement, markdown: string, pyodide: PyodideInterface, mdastExtensions: Extension[]): void;
|
|
3
4
|
export declare function renderMathAsync(element: HTMLElement, latexCode: string): Promise<void>;
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Markdown/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Markdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAgB,MAAM,0BAA0B,CAAC;AAUnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,gBAAgB,EACzB,eAAe,EAAE,SAAS,EAAE,QAW7B;AAyXD,wBAAsB,eAAe,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iBAS5E"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ChatMessageItem } from "../../ChatMessageItem";
|
|
2
|
+
import { Extension } from "mdast-util-from-markdown";
|
|
2
3
|
export interface AIChatOptions {
|
|
3
4
|
userId: string;
|
|
4
5
|
givenName: string;
|
|
@@ -26,6 +27,7 @@ export declare class AIChat {
|
|
|
26
27
|
readonly frontEndFunctions: {
|
|
27
28
|
[functionName: string]: (...args: any[]) => any;
|
|
28
29
|
};
|
|
30
|
+
readonly mdastExtensions: Extension[];
|
|
29
31
|
pyodide: any;
|
|
30
32
|
private _initializePyodidePromise;
|
|
31
33
|
initializePyodideAsync(): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AIChat/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAOxD,OAAO,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AIChat/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAOxD,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,OAAO,MAAM,CAAC,KAAK,CAAC;CAC7B;AAED,qBAAa,UAAU;IACrB,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,eAAe,EAAE,CAAM;;CAI3C;AAED,qBAAa,MAAM;IACjB,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,OAAO,MAAM,CAAC,KAAK,CAAC;IACpC,QAAQ,CAAC,QAAQ,aAAoB;IACrC,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC;IAC1B,QAAQ,CAAC,iBAAiB,EAAE;QAAE,CAAC,YAAY,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;KAAE,CAAM;IACrF,QAAQ,CAAC,eAAe,EAAE,SAAS,EAAE,CAAM;IAE3C,OAAO,EAAE,GAAG,CAAC;IACb,OAAO,CAAC,yBAAyB,CAA8C;IAE/E,sBAAsB,IAAI,OAAO,CAAC,GAAG,CAAC;IAIhC,mBAAmB;IAUnB,kBAAkB,CAAC,IAAI,EAAE,MAAM;IAMrC,OAAO,CAAC,WAAW,CAAoB;IAEvC,IAAI,SAAS,YAEZ;gBAEW,OAAO,EAAE,aAAa;IA6D5B,kBAAkB,CAAC,OAAO,EAAE,MAAM;IAmDxC,IAAI;CA6CL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AIChatAgentMessage.d.ts","sourceRoot":"","sources":["../../src/components/AIChatAgentMessage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AIChatAgentMessage.d.ts","sourceRoot":"","sources":["../../src/components/AIChatAgentMessage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAAE,MA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F;;;;;;OAMG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAM7D,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,qBAAqB,CAAS;IACtC,OAAO,CAAC,UAAU,CAAS;IAE3B,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAIlD,wBAAwB,IAAI,mBAAmB;IAI/C,OAAO,CAAC,yBAAyB;IAQjC,OAAO,CAAC,eAAe,CAAiB;IAGxC,OAAO,CAAC,uBAAuB;IAe/B,OAAO,CAAC,aAAa,CAAqB;IAE1C,KAAK;IAKL,2BAA2B;IAC3B,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAEtD,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAU9E,QAAQ,CAAC,QAAQ,EAAE,MAAM;IAIzB,IAAI;IAiBJ,KAAK,CAAC,KAAK,EAAE,MAAM;IAyBnB,OAAO,CAAC,WAAW;CAYpB"}
|
package/dist/veracity-ai.es.js
CHANGED
|
@@ -3515,12 +3515,12 @@ function Rs(e) {
|
|
|
3515
3515
|
i % 2 === 0 && (n[i] = n[i].replace(r, (a, o) => `$${o}$`).replace(s, (a, o) => `$$${o}$$`));
|
|
3516
3516
|
return n.join("");
|
|
3517
3517
|
}
|
|
3518
|
-
function qe(e, t, n) {
|
|
3519
|
-
const
|
|
3518
|
+
function qe(e, t, n, r) {
|
|
3519
|
+
const s = ds(Rs(t), {
|
|
3520
3520
|
extensions: [bs(), Ds()],
|
|
3521
|
-
mdastExtensions: [ks(), Ns()]
|
|
3522
|
-
}),
|
|
3523
|
-
xn(
|
|
3521
|
+
mdastExtensions: [ks(), Ns(), ...r]
|
|
3522
|
+
}), i = {}, a = {};
|
|
3523
|
+
xn(s, i, a), ct(s, e, i, a, n);
|
|
3524
3524
|
}
|
|
3525
3525
|
function xn(e, t, n) {
|
|
3526
3526
|
for (const r of e.children) {
|
|
@@ -3987,7 +3987,7 @@ class yn {
|
|
|
3987
3987
|
};
|
|
3988
3988
|
}
|
|
3989
3989
|
appendAgentMarkdownMessage(t) {
|
|
3990
|
-
this._currentMarkdownNode || (this.reset(), this.contentNode.appendChild(this._currentMarkdownNode = /* @__PURE__ */ S("div", { class: "mt-1.5 prose prose-neutral max-w-none" })), this.size === 0 && this._currentMarkdownNode.classList.add("prose-sm")), this._currentMarkdown ? this._currentMarkdown += t : this._currentMarkdown = t, this._latestMarkdown = this._currentMarkdown, qe(this._currentMarkdownNode, this._currentMarkdown, this.chat.pyodide);
|
|
3990
|
+
this._currentMarkdownNode || (this.reset(), this.contentNode.appendChild(this._currentMarkdownNode = /* @__PURE__ */ S("div", { class: "mt-1.5 prose prose-neutral max-w-none" })), this.size === 0 && this._currentMarkdownNode.classList.add("prose-sm")), this._currentMarkdown ? this._currentMarkdown += t : this._currentMarkdown = t, this._latestMarkdown = this._currentMarkdown, qe(this._currentMarkdownNode, this._currentMarkdown, this.chat.pyodide, this.chat.mdastExtensions);
|
|
3991
3991
|
}
|
|
3992
3992
|
getOrAppendToolCallGroup() {
|
|
3993
3993
|
return this._currentToolCallGroup || (this.reset(), this.contentNode.appendChild((this._currentToolCallGroup = new Gs(this.chat)).node)), this._currentToolCallGroup;
|
|
@@ -4077,7 +4077,7 @@ class ia {
|
|
|
4077
4077
|
C(this, "_iconNode");
|
|
4078
4078
|
C(this, "_markdown");
|
|
4079
4079
|
C(this, "_markdownNode");
|
|
4080
|
-
this._icon = t, this._markdown = n, this.node = /* @__PURE__ */ S(ft, null, this._iconNode = tn(t), this._markdownNode = /* @__PURE__ */ S("span", null)), qe(this._markdownNode, this._markdown, null);
|
|
4080
|
+
this._icon = t, this._markdown = n, this.node = /* @__PURE__ */ S(ft, null, this._iconNode = tn(t), this._markdownNode = /* @__PURE__ */ S("span", null)), qe(this._markdownNode, this._markdown, null, []);
|
|
4081
4081
|
}
|
|
4082
4082
|
get icon() {
|
|
4083
4083
|
return this._icon;
|
|
@@ -4089,7 +4089,7 @@ class ia {
|
|
|
4089
4089
|
return this._markdown;
|
|
4090
4090
|
}
|
|
4091
4091
|
set markdown(t) {
|
|
4092
|
-
t !== this._markdown && (qe(this._markdownNode, this._markdown = t, null), this._markdown = t);
|
|
4092
|
+
t !== this._markdown && (qe(this._markdownNode, this._markdown = t, null, []), this._markdown = t);
|
|
4093
4093
|
}
|
|
4094
4094
|
status(t, n, r) {
|
|
4095
4095
|
this.icon = n, this.markdown = r;
|
|
@@ -4287,7 +4287,11 @@ class be {
|
|
|
4287
4287
|
s += l, this.appendPythonStdouterr(l, !0);
|
|
4288
4288
|
}
|
|
4289
4289
|
}), this._pythonStdouterrContainerNode = null;
|
|
4290
|
-
var i = await this.chat.runPythonCodeAsync(n);
|
|
4290
|
+
var i = await this.chat.runPythonCodeAsync(n), a = String(i);
|
|
4291
|
+
if (1e3 <= a.length)
|
|
4292
|
+
throw new Error(
|
|
4293
|
+
"The Python code executed successfully, but the result is too long to be suitable as an input for an LLM. Focus on returning summary statistics or specific values instead of large datasets, like counts instead of entire lists. If operations produce large structures (e.g., arrays, maps), process them within Python and return only the relevant result. Perform calculations, filtering, or summarization within Python to avoid transferring large data back to the LLM."
|
|
4294
|
+
);
|
|
4291
4295
|
} catch (l) {
|
|
4292
4296
|
console.error(l);
|
|
4293
4297
|
const u = String(l);
|
|
@@ -4307,7 +4311,6 @@ class be {
|
|
|
4307
4311
|
throw new Error(`Server returned ${h.status} ${h.statusText}`);
|
|
4308
4312
|
return;
|
|
4309
4313
|
}
|
|
4310
|
-
const a = String(i);
|
|
4311
4314
|
this.appendPythonResultRow(a, !1);
|
|
4312
4315
|
const o = await this.chat.fetch(this.chat.url, {
|
|
4313
4316
|
method: "POST",
|
|
@@ -4421,7 +4424,7 @@ class be {
|
|
|
4421
4424
|
i.status(n, r, s);
|
|
4422
4425
|
}
|
|
4423
4426
|
setTitle(t) {
|
|
4424
|
-
qe(this._titleTextNode, t, null);
|
|
4427
|
+
qe(this._titleTextNode, t, null, []);
|
|
4425
4428
|
}
|
|
4426
4429
|
done() {
|
|
4427
4430
|
if (this.node.getAttribute("data-status") === "error")
|
|
@@ -4959,7 +4962,7 @@ function ga(e, t, n) {
|
|
|
4959
4962
|
},
|
|
4960
4963
|
"No, cancel"
|
|
4961
4964
|
)));
|
|
4962
|
-
return qe(i, t, null), a;
|
|
4965
|
+
return qe(i, t, null, []), a;
|
|
4963
4966
|
}
|
|
4964
4967
|
});
|
|
4965
4968
|
}
|
|
@@ -5789,6 +5792,7 @@ class Va {
|
|
|
5789
5792
|
C(this, "chatBase", new Wa());
|
|
5790
5793
|
C(this, "statusNode");
|
|
5791
5794
|
C(this, "frontEndFunctions", {});
|
|
5795
|
+
C(this, "mdastExtensions", []);
|
|
5792
5796
|
C(this, "pyodide");
|
|
5793
5797
|
C(this, "_initializePyodidePromise");
|
|
5794
5798
|
//private _canSubmit = true;
|