@yushaw/sanqian-ai-sdk 0.1.0 → 0.1.1

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/dist/index.js CHANGED
@@ -962,7 +962,7 @@ var SANQIAN_CAPABILITIES = {
962
962
  streamingText: true,
963
963
  reasoning: true,
964
964
  toolCalling: true,
965
- parallelToolCalls: true,
965
+ parallelToolCalls: false,
966
966
  toolArgsStreaming: true,
967
967
  abort: true,
968
968
  hitl: true,
@@ -1840,6 +1840,7 @@ var VercelProvider = class {
1840
1840
  try {
1841
1841
  let completedSteps = 0;
1842
1842
  let finishReason;
1843
+ const toolInputNames = /* @__PURE__ */ new Map();
1843
1844
  const result = (0, import_ai.streamText)({
1844
1845
  model,
1845
1846
  system,
@@ -1869,6 +1870,23 @@ var VercelProvider = class {
1869
1870
  }
1870
1871
  break;
1871
1872
  }
1873
+ case "tool-input-start": {
1874
+ const startPart = part;
1875
+ if (startPart.id) toolInputNames.set(startPart.id, startPart.toolName ?? "");
1876
+ break;
1877
+ }
1878
+ case "tool-input-delta": {
1879
+ const deltaPart = part;
1880
+ if (deltaPart.id && deltaPart.delta) {
1881
+ yield {
1882
+ type: "tool_args_chunk",
1883
+ toolCallId: deltaPart.id,
1884
+ toolName: toolInputNames.get(deltaPart.id) ?? "",
1885
+ chunk: deltaPart.delta
1886
+ };
1887
+ }
1888
+ break;
1889
+ }
1872
1890
  case "tool-call": {
1873
1891
  const toolPart = part;
1874
1892
  yield {
@@ -1919,8 +1937,7 @@ var VercelProvider = class {
1919
1937
  yield { type: "error", error: this.redactSecrets(errorMessage) };
1920
1938
  return;
1921
1939
  }
1922
- // text-start, text-end, reasoning-start, reasoning-end,
1923
- // tool-input-start, tool-input-end, tool-input-delta,
1940
+ // text-start, text-end, reasoning-start, reasoning-end, tool-input-end,
1924
1941
  // start-step, source, file - skip
1925
1942
  default:
1926
1943
  break;