@blueking/ai-blueking 0.3.12 → 0.3.14

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
@@ -170,15 +170,19 @@ npm i @blueking/ai-blueking
170
170
  };
171
171
 
172
172
  // 聊天结束
173
- const handleEnd = (id: number | string) => {
173
+ const handleEnd = (id: number | string, message?: string) => {
174
174
  loading.value = false;
175
175
  const currentMessage = messages.value.at(-1);
176
- // loading 情况下终止
177
- if (currentMessage.status === MessageStatus.Loading) {
176
+ if (message) {
177
+ // done 的情况下,返回 message,直接覆盖
178
+ currentMessage.content = message;
179
+ currentMessage.status = MessageStatus.Success;
180
+ } else if (currentMessage.status === MessageStatus.Loading) {
181
+ // loading 情况下终止
178
182
  currentMessage.content = '聊天内容已中断';
179
183
  currentMessage.status = MessageStatus.Error;
180
184
  }
181
- };
185
+ }
182
186
 
183
187
  // 错误处理
184
188
  const handleError = (message: string, code: string | number, id: number | string) => {
@@ -23,8 +23,8 @@ interface IProps {
23
23
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<IProps>, {
24
24
  setInputMessage: (val: string) => void;
25
25
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
26
- stop: () => void;
27
26
  close: () => void;
27
+ stop: () => void;
28
28
  clear: () => void;
29
29
  "scroll-load": () => void;
30
30
  "change-prompt": (val: string) => void;
@@ -26,5 +26,13 @@ export declare const langData: {
26
26
  readonly 您选择的文本内容: "The text content you selected";
27
27
  readonly 问小鲸: "Ask BK GPT";
28
28
  readonly 想对选中的文本做什么: "What do you want to do with the selected text?";
29
+ readonly translateShortcut: "You are a highly skilled AI trained in language translation. I would like you to translate the text delimited by triple quotes (Translation of Chinese into English and other languages into Chinese), ensuring that the translation is colloquial and authentic.\n Only give me the output and nothing else. Do not wrap responses in quotes\n '''\n {{ SELECTED_TEXT }}\n '''\n ";
30
+ readonly explanationShortcut: "You are a professional explainer. Please provide a detailed explanation of \"{{ SELECTED_TEXT }}\". Your explanation should include: 1) basic meaning and conceptual explanation; 2) practical applications or use cases; 3) if it's a technical term, please provide relevant technical background; 4) where appropriate, provide specific examples to aid understanding. Use clear and accessible language to ensure non-experts can understand. If the word/phrase has multiple meanings, please list the main definitions. Keep your response concise and clear while ensuring completeness and accuracy of information.";
31
+ readonly 翻译: "translate";
32
+ readonly 解释: "explan";
29
33
  };
30
- export declare const t: (key: keyof typeof langData) => "close" | "BK GPT" | "shrink down" | "expand upward" | "Empty chat records" | "The content is being executed, please send it after the execution is completed." | "Send" | "You can type \"/\" to see more Prompts" | "Please input" | "Latest" | "Stop" | "Scroll up to load more records" | " sunday" | " monday" | " tuesday" | " wednesday" | " thursday" | " friday" | " saturday" | "yesterday" | "this week" | "last week" | "Copy success" | "The text content you selected" | "Ask BK GPT" | "What do you want to do with the selected text?" | "小鲸" | "向下收缩" | "向上扩展" | "清空聊天记录" | "关闭" | "内容正在执行中,请执行完成后再发送" | "发送" | "您可以键入 “/” 查看更多Prompt" | "请输入" | "返回最新" | "终止生成" | "向上滚动加载更多记录" | "日" | "一" | "二" | "三" | "四" | "五" | "六" | "昨天" | "本周" | "上周" | "复制成功" | "您选择的文本内容" | "问小鲸" | "想对选中的文本做什么";
34
+ export declare const zhLangData: {
35
+ translateShortcut: string;
36
+ explanationShortcut: string;
37
+ };
38
+ export declare const t: (key: string) => string;