@blueking/chat-helper 0.0.10-dev.1 → 0.0.10-dev.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.
@@ -138,7 +138,7 @@ import { SessionStatus } from '../session/type.ts.js';
138
138
  };
139
139
  const streamRequest = function() {
140
140
  var _ref = _async_to_generator(function*({ sessionCode, url, config, resume, input }) {
141
- var // 发起聊天
141
+ var _mediator_message_list_value_at, _mediator_message, // 发起聊天
142
142
  _mediator_http;
143
143
  // ag-ui 协议需要注入消息模块
144
144
  if (usedProtocol instanceof AGUIProtocol) {
@@ -146,8 +146,8 @@ import { SessionStatus } from '../session/type.ts.js';
146
146
  }
147
147
  if (input) {
148
148
  var // 列表新增一个用户消息
149
- _mediator_message;
150
- (_mediator_message = mediator.message) === null || _mediator_message === void 0 ? void 0 : _mediator_message.list.value.push({
149
+ _mediator_message1;
150
+ (_mediator_message1 = mediator.message) === null || _mediator_message1 === void 0 ? void 0 : _mediator_message1.list.value.push({
151
151
  role: MessageRole.User,
152
152
  content: input,
153
153
  status: MessageStatus.Complete,
@@ -186,6 +186,8 @@ import { SessionStatus } from '../session/type.ts.js';
186
186
  isChatting.value = true;
187
187
  (_usedProtocol_onStart = usedProtocol.onStart) === null || _usedProtocol_onStart === void 0 ? void 0 : _usedProtocol_onStart.call(usedProtocol);
188
188
  };
189
+ // 获取最后一条消息的 id
190
+ const lastMessageId = (_mediator_message = mediator.message) === null || _mediator_message === void 0 ? void 0 : (_mediator_message_list_value_at = _mediator_message.list.value.at(-1)) === null || _mediator_message_list_value_at === void 0 ? void 0 : _mediator_message_list_value_at.id;
189
191
  // 创建 AbortController
190
192
  abortController = new AbortController();
191
193
  (_mediator_http = mediator.http) === null || _mediator_http === void 0 ? void 0 : _mediator_http.fetchClient.streamRequest(_object_spread({
@@ -197,6 +199,7 @@ import { SessionStatus } from '../session/type.ts.js';
197
199
  execute_kwargs: {
198
200
  stream: true,
199
201
  persist_input: !!input,
202
+ last_message_id: lastMessageId,
200
203
  resume
201
204
  }
202
205
  },
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@blueking/chat-helper",
3
- "version": "0.0.10-dev.1",
3
+ "version": "0.0.10-dev.2",
4
4
  "description": "",
5
5
  "main": "./dist/index.ts.js",
6
6
  "types": "./dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "bk-cli-service build && vue-tsc --emitDeclarationOnly"
9
+ },
7
10
  "keywords": [
8
11
  "chat-helper"
9
12
  ],
@@ -17,6 +20,7 @@
17
20
  "url": "https://github.com/TencentBlueKing/bk-aidev-agent.git",
18
21
  "directory": "src/frontend/ai-blueking/packages/chat-helper"
19
22
  },
23
+ "packageManager": "pnpm@10.17.1",
20
24
  "peerDependencies": {
21
25
  "vue": "^3.5.24"
22
26
  },
@@ -28,8 +32,5 @@
28
32
  },
29
33
  "dependencies": {
30
34
  "@types/json-schema": "^7.0.15"
31
- },
32
- "scripts": {
33
- "build": "bk-cli-service build && vue-tsc --emitDeclarationOnly"
34
35
  }
35
- }
36
+ }