@blueking/ai-blueking 0.3.20 → 0.3.22

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.
@@ -0,0 +1,22 @@
1
+ import { RoleType, MessageStatus } from '../types/enum';
2
+ interface UseBkAiOptions {
3
+ useStream?: boolean;
4
+ apiUrl?: string;
5
+ }
6
+ export declare function useBkAi(options?: UseBkAiOptions): {
7
+ loading: import("vue").Ref<boolean>;
8
+ messages: import("vue").Ref<{
9
+ status?: MessageStatus | undefined;
10
+ time?: string | number | undefined;
11
+ cite?: string | undefined;
12
+ role: RoleType;
13
+ content: string;
14
+ }[]>;
15
+ isShow: import("vue").Ref<boolean>;
16
+ handleShowAi: () => void;
17
+ handleClose: () => void;
18
+ handleClear: () => void;
19
+ handleSend: (args: any) => void;
20
+ handleStop: () => void;
21
+ };
22
+ export {};
@@ -20975,9 +20975,9 @@ class R_ {
20975
20975
  `).forEach((f) => {
20976
20976
  const y = f.replace("data:", "").trim();
20977
20977
  if (jh(y)) {
20978
- const { event: d, content: v, documents: p, result: C, code: g, message: _ } = JSON.parse(y);
20979
- if (C === !1 || i.status !== 200) {
20980
- this.handleError(_, g, n);
20978
+ const { event: d, content: v, cover: p, documents: C, result: g, code: _, message: z } = JSON.parse(y);
20979
+ if (g === !1 || i.status !== 200) {
20980
+ this.handleError(z, _, n);
20981
20981
  return;
20982
20982
  }
20983
20983
  switch (d) {
@@ -20985,14 +20985,14 @@ class R_ {
20985
20985
  this.handleReceiveMessage(v, n);
20986
20986
  break;
20987
20987
  case "reference_doc":
20988
- const z = k_(p);
20989
- this.handleReceiveMessage(z, n);
20988
+ const R = k_(C);
20989
+ this.handleReceiveMessage(R, n);
20990
20990
  break;
20991
20991
  case "done":
20992
- this.handleEnd(n, v);
20992
+ this.handleEnd(n, p ? v : "");
20993
20993
  break;
20994
20994
  case "error":
20995
- this.handleError(_, g, n);
20995
+ this.handleError(z, _, n);
20996
20996
  break;
20997
20997
  }
20998
20998
  } else