@opentiny/genui-sdk-vue 1.1.2 → 1.2.0-alpha.2
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/ConfigProvider-BaJsiFgd.js +86 -0
- package/dist/SchemaCardRenderer-CdV5OdhD.js +13440 -0
- package/dist/___vite-browser-external_commonjs-proxy-4gYZYw55.js +56 -0
- package/dist/chat.d.ts +2882 -0
- package/dist/chat.js +22 -0
- package/dist/chat.types-Bz1iNdhu.js +1753 -0
- package/dist/config-provider.d.ts +54 -0
- package/dist/config-provider.js +5 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +27 -82441
- package/dist/injection-tokens-D8CFCpjy.js +114 -0
- package/dist/renderer.d.ts +2099 -0
- package/dist/renderer.js +5 -0
- package/dist/transform-jsx.d.ts +3 -0
- package/dist/transform-jsx.js +67051 -0
- package/package.json +47 -2
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { ref as E, reactive as h, readonly as x } from "vue";
|
|
2
|
+
const S = { response: "响应中...", generatingCard: "正在生成卡片...", thinking: "正在思考中..." }, F = { thinking: "正在思考", thinkingEnd: "已思考" }, N = { running: "正在调用", success: "已调用", failed: "调用失败", cancelled: "已取消" }, v = { title: "出错了" }, _ = { thinking: "正在思考中...", input: "请输入您的问题~" }, M = { aiGenerated: "内容由AI生成,仅供参考" }, z = { newConversation: "新会话" }, b = { description: "继续对话,用于表单的提交按钮等", messageParam: "相关参数为:", paramDescription: "对话消息,可以是按钮文本等,也可以是其他内容" }, T = { description: "保存状态,用于保存组件状态" }, k = { context: "工具名称:{toolName},工具参数:{toolParams},工具结果:{toolResult}" }, I = { error: { processFailed: "文件处理失败", validationFailed: "文件验证失败", unknownError: "未知错误", fileSizeExceeded: "文件大小不能超过 {maxSizeMB}MB,当前文件大小:{currentSizeMB}MB", unsupportedModel: "不支持的模型", unsupportedFormat: "模型不支持 .{extension} 文件格式", sizeLimitExceeded: "文件大小超过限制(最大 {maxSize}MB)", maxFilesExceeded: "单次最多支持 {maxFiles} 个文件", unsupportedFileType: "模型不支持处理此类型的文件: {fileCategory}" } }, U = { error: { displayError: "[显示异常]" } }, O = { requestFailed: "请求失败,请稍后重试" }, $ = {
|
|
3
|
+
loading: S,
|
|
4
|
+
reasoning: F,
|
|
5
|
+
toolStatus: N,
|
|
6
|
+
error: v,
|
|
7
|
+
placeholder: _,
|
|
8
|
+
footer: M,
|
|
9
|
+
conversation: z,
|
|
10
|
+
continueChat: b,
|
|
11
|
+
saveState: T,
|
|
12
|
+
toolCall: k,
|
|
13
|
+
fileUpload: I,
|
|
14
|
+
renderer: U,
|
|
15
|
+
message: O
|
|
16
|
+
}, G = { response: "Responding...", generatingCard: "Generating cards...", thinking: "Thinking..." }, R = { thinking: "Thinking", thinkingEnd: "Thinking End" }, w = { running: "Running", success: "Succeeded", failed: "Failed", cancelled: "Cancelled" }, B = { title: "Error" }, P = { thinking: "Thinking...", input: "Please enter your question~" }, L = { aiGenerated: "Content generated by AI, for reference only" }, j = { newConversation: "New Conversation" }, q = { description: "Continue conversation, used for form submit buttons, etc.", messageParam: "Related parameters: ", paramDescription: "Conversation message, can be button text or other content" }, D = { description: "Save state, used for saving component state" }, A = { context: "Tool name: {toolName}, Tool parameters: {toolParams}, Tool result: {toolResult}" }, V = { error: { processFailed: "File processing failed", validationFailed: "File validation failed", unknownError: "Unknown error", fileSizeExceeded: "File size cannot exceed {maxSizeMB}MB, current file size: {currentSizeMB}MB", unsupportedModel: "Unsupported model", unsupportedFormat: "Model does not support .{extension} file format", sizeLimitExceeded: "File size exceeds limit (max {maxSize}MB)", maxFilesExceeded: "Maximum {maxFiles} files per request", unsupportedFileType: "Model does not support processing this type of file: {fileCategory}" } }, X = { error: { displayError: "[Display Error]" } }, H = { requestFailed: "Request failed, please try again later" }, J = {
|
|
17
|
+
loading: G,
|
|
18
|
+
reasoning: R,
|
|
19
|
+
toolStatus: w,
|
|
20
|
+
error: B,
|
|
21
|
+
placeholder: P,
|
|
22
|
+
footer: L,
|
|
23
|
+
conversation: j,
|
|
24
|
+
continueChat: q,
|
|
25
|
+
saveState: D,
|
|
26
|
+
toolCall: A,
|
|
27
|
+
fileUpload: V,
|
|
28
|
+
renderer: X,
|
|
29
|
+
message: H
|
|
30
|
+
};
|
|
31
|
+
function K(a = {}) {
|
|
32
|
+
const d = {
|
|
33
|
+
locale: "zh_CN",
|
|
34
|
+
messages: {}
|
|
35
|
+
}, l = {
|
|
36
|
+
...d,
|
|
37
|
+
...a,
|
|
38
|
+
messages: { ...d.messages, ...a.messages }
|
|
39
|
+
}, r = E(l.locale), i = h(
|
|
40
|
+
structuredClone(l.messages)
|
|
41
|
+
);
|
|
42
|
+
function u(e) {
|
|
43
|
+
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
44
|
+
}
|
|
45
|
+
function g(e, t) {
|
|
46
|
+
if (!u(e))
|
|
47
|
+
return structuredClone(t);
|
|
48
|
+
if (!u(t))
|
|
49
|
+
return structuredClone(e);
|
|
50
|
+
for (const n in t)
|
|
51
|
+
if (Object.prototype.hasOwnProperty.call(t, n)) {
|
|
52
|
+
const s = e[n], o = t[n];
|
|
53
|
+
u(s) && u(o) ? e[n] = g(
|
|
54
|
+
s,
|
|
55
|
+
o
|
|
56
|
+
) : e[n] = structuredClone(o);
|
|
57
|
+
}
|
|
58
|
+
return e;
|
|
59
|
+
}
|
|
60
|
+
function f(e) {
|
|
61
|
+
if (typeof e != "string" || e.trim() === "") {
|
|
62
|
+
console.warn("语言标识必须是非空字符串!");
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const t = e.trim();
|
|
66
|
+
r.value !== t && (r.value = t);
|
|
67
|
+
}
|
|
68
|
+
function C(e, t = !1) {
|
|
69
|
+
if (typeof e != "object" || e === null) {
|
|
70
|
+
console.warn("要合并的词条必须是合法对象!");
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
for (const n in e)
|
|
74
|
+
if (Object.prototype.hasOwnProperty.call(e, n)) {
|
|
75
|
+
const s = e[n], o = i[n];
|
|
76
|
+
!o || t ? i[n] = structuredClone(s) : g(o, s);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function y(e, t = {}) {
|
|
80
|
+
if (typeof e != "string" || e.trim() === "")
|
|
81
|
+
return "";
|
|
82
|
+
const n = e.trim(), s = r.value, o = i[s] || {}, m = n.split(".").reduce((c, p) => (c == null ? void 0 : c[p]) || n, o);
|
|
83
|
+
return typeof m != "string" ? n : m.replace(/\{(\w+)\}/g, (c, p) => t.hasOwnProperty(p) ? String(t[p]) : c);
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
locale: r,
|
|
87
|
+
messages: x(i),
|
|
88
|
+
setLocale: f,
|
|
89
|
+
mergeMessages: C,
|
|
90
|
+
t: y
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
const Q = K({
|
|
94
|
+
locale: "zh_CN",
|
|
95
|
+
// 默认语言
|
|
96
|
+
messages: {
|
|
97
|
+
zh_CN: $,
|
|
98
|
+
en_US: J
|
|
99
|
+
}
|
|
100
|
+
}), Y = () => Q, Z = (a, d) => {
|
|
101
|
+
const l = a.__vccOpts || a;
|
|
102
|
+
for (const [r, i] of d)
|
|
103
|
+
l[r] = i;
|
|
104
|
+
return l;
|
|
105
|
+
}, ee = Symbol("GENUI_I18N"), ne = Symbol("GENUI_RENDERER"), te = Symbol("GENUI_CONFIG"), oe = Symbol("CUSTOM_CONTEXT");
|
|
106
|
+
export {
|
|
107
|
+
oe as C,
|
|
108
|
+
ee as G,
|
|
109
|
+
Z as _,
|
|
110
|
+
ne as a,
|
|
111
|
+
te as b,
|
|
112
|
+
K as c,
|
|
113
|
+
Y as u
|
|
114
|
+
};
|