@yushaw/sanqian-chat 0.2.43 → 0.3.0

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.
@@ -575,7 +575,14 @@ function registerStreamIpcHandlers(ipcMainHandle, ctx) {
575
575
  (runId, ownerWebContentsId) => ctx.rememberRunOwner(runId, ownerWebContentsId),
576
576
  { overwrite: true }
577
577
  );
578
- webContents.send("sanqian-chat:streamEvent", { streamId, event: { type: "start", run_id: startEvt.run_id } });
578
+ webContents.send("sanqian-chat:streamEvent", {
579
+ streamId,
580
+ event: {
581
+ type: "start",
582
+ run_id: startEvt.run_id,
583
+ conversationId: startEvt.conversationId
584
+ }
585
+ });
579
586
  break;
580
587
  }
581
588
  case "text":
@@ -587,6 +594,28 @@ function registerStreamIpcHandlers(ipcMainHandle, ctx) {
587
594
  case "tool_call":
588
595
  webContents.send("sanqian-chat:streamEvent", { streamId, event: { type: "tool_call", tool_call: evt.tool_call } });
589
596
  break;
597
+ case "tool_args_chunk":
598
+ webContents.send("sanqian-chat:streamEvent", {
599
+ streamId,
600
+ event: {
601
+ type: "tool_args_chunk",
602
+ tool_call_id: evt.tool_call_id,
603
+ tool_name: evt.tool_name,
604
+ chunk: evt.chunk
605
+ }
606
+ });
607
+ break;
608
+ case "tool_args":
609
+ webContents.send("sanqian-chat:streamEvent", {
610
+ streamId,
611
+ event: {
612
+ type: "tool_args",
613
+ tool_call_id: evt.tool_call_id,
614
+ tool_name: evt.tool_name,
615
+ args: evt.args
616
+ }
617
+ });
618
+ break;
590
619
  case "tool_result":
591
620
  webContents.send("sanqian-chat:streamEvent", { streamId, event: { type: "tool_result", tool_call_id: evt.tool_call_id, result: evt.result } });
592
621
  break;
@@ -544,7 +544,14 @@ function registerStreamIpcHandlers(ipcMainHandle, ctx) {
544
544
  (runId, ownerWebContentsId) => ctx.rememberRunOwner(runId, ownerWebContentsId),
545
545
  { overwrite: true }
546
546
  );
547
- webContents.send("sanqian-chat:streamEvent", { streamId, event: { type: "start", run_id: startEvt.run_id } });
547
+ webContents.send("sanqian-chat:streamEvent", {
548
+ streamId,
549
+ event: {
550
+ type: "start",
551
+ run_id: startEvt.run_id,
552
+ conversationId: startEvt.conversationId
553
+ }
554
+ });
548
555
  break;
549
556
  }
550
557
  case "text":
@@ -556,6 +563,28 @@ function registerStreamIpcHandlers(ipcMainHandle, ctx) {
556
563
  case "tool_call":
557
564
  webContents.send("sanqian-chat:streamEvent", { streamId, event: { type: "tool_call", tool_call: evt.tool_call } });
558
565
  break;
566
+ case "tool_args_chunk":
567
+ webContents.send("sanqian-chat:streamEvent", {
568
+ streamId,
569
+ event: {
570
+ type: "tool_args_chunk",
571
+ tool_call_id: evt.tool_call_id,
572
+ tool_name: evt.tool_name,
573
+ chunk: evt.chunk
574
+ }
575
+ });
576
+ break;
577
+ case "tool_args":
578
+ webContents.send("sanqian-chat:streamEvent", {
579
+ streamId,
580
+ event: {
581
+ type: "tool_args",
582
+ tool_call_id: evt.tool_call_id,
583
+ tool_name: evt.tool_name,
584
+ args: evt.args
585
+ }
586
+ });
587
+ break;
559
588
  case "tool_result":
560
589
  webContents.send("sanqian-chat:streamEvent", { streamId, event: { type: "tool_result", tool_call_id: evt.tool_call_id, result: evt.result } });
561
590
  break;