Skip to content

Commit 68fb388

Browse files
author
linyuan.yang
committed
insights
1 parent 80ec195 commit 68fb388

1 file changed

Lines changed: 2 additions & 14 deletions

File tree

packages/scorpio.ai/src/Agents/Single/SingleAgentService.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,6 @@ export class SingleAgentService extends AgentServiceBase {
176176
...savedHistory,
177177
];
178178

179-
// this.logger?.debug(`tools count : ${state.tools.length} messages:${messages.length} historyMessages:${historyMessages.length}`)
180-
// for (const msg of messages) {
181-
// const role = msg.constructor.name;
182-
// const contentStr = (typeof msg.content === 'string' ? msg.content : JSON.stringify(msg.content)).replace(/\r?\n/g, ' ');
183-
// this.logger?.debug(` [${role}] ${contentStr.length > 100 ? contentStr.slice(0, 100) + '…' : contentStr}`);
184-
// }
185-
186179
if (state.signal?.aborted) throw new AgentCancelledError();
187180

188181
const mergedSignal = this.modelCallTimeout != null
@@ -357,10 +350,8 @@ export class SingleAgentService extends AgentServiceBase {
357350
await this.saverService.pushMessage(message, thinkId ? { thinkId } : undefined);
358351

359352
if (message.role === MessageRole.AI) {
360-
const content = message.content;
361-
if (typeof content === 'string' && content) {
362-
aiResponses.push(content);
363-
}
353+
const text = contentToString(message.content);
354+
if (text) aiResponses.push(text);
364355
}
365356

366357
if (callback.onMessage) {
@@ -373,11 +364,8 @@ export class SingleAgentService extends AgentServiceBase {
373364
// tools node 的补偿消息已全部写入 saver,配对完整后再抛出
374365
if (signal?.aborted) throw new AgentCancelledError();
375366
}
376-
377-
console.log("----------------------------------------", this.insightService)
378367
// 静默提取 insight
379368
if (this.insightService) {
380-
381369
try {
382370
await this.insightService.extractFromConversation(
383371
contentToString(query),

0 commit comments

Comments
 (0)