@yushaw/sanqian-ai-sdk 0.1.0 → 0.1.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.
- package/dist/index.d.mts +17 -1
- package/dist/index.d.ts +17 -1
- package/dist/index.js +39 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -3
- package/dist/index.mjs.map +1 -1
- package/dist/testing.d.mts +16 -0
- package/dist/testing.d.ts +16 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -120,6 +120,20 @@ interface RuntimeConnectionSnapshot {
|
|
|
120
120
|
errorCode?: RuntimeConnectionErrorCode;
|
|
121
121
|
lastChangedAt: number;
|
|
122
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* Per-request tool-choice constraint (mirrors Vercel AI SDK / OpenAI semantics).
|
|
125
|
+
* - 'auto' (default): the model decides whether to call tools.
|
|
126
|
+
* - 'none': the model must not call tools.
|
|
127
|
+
* - 'required': the model MUST call at least one tool this turn.
|
|
128
|
+
* - { type: 'tool', toolName }: the model MUST call the named tool.
|
|
129
|
+
* Providers that cannot honor a constraining value MUST throw instead of silently
|
|
130
|
+
* degrading to 'auto' — callers rely on this for command-style requests where a
|
|
131
|
+
* hallucinated "done" without a tool call is a correctness bug.
|
|
132
|
+
*/
|
|
133
|
+
type RuntimeToolChoice = 'auto' | 'none' | 'required' | {
|
|
134
|
+
type: 'tool';
|
|
135
|
+
toolName: string;
|
|
136
|
+
};
|
|
123
137
|
interface RuntimeChatRequest {
|
|
124
138
|
agentId: string;
|
|
125
139
|
messages: RuntimeMessage[];
|
|
@@ -127,6 +141,7 @@ interface RuntimeChatRequest {
|
|
|
127
141
|
providerInstanceId?: string;
|
|
128
142
|
operationId?: string;
|
|
129
143
|
tools?: RuntimeToolDefinition[];
|
|
144
|
+
toolChoice?: RuntimeToolChoice;
|
|
130
145
|
contexts?: RuntimeContext[];
|
|
131
146
|
resources?: RuntimeResourceRef[];
|
|
132
147
|
sessionResources?: RuntimeResource[];
|
|
@@ -145,6 +160,7 @@ interface RuntimeChatStreamRequest {
|
|
|
145
160
|
providerInstanceId?: string;
|
|
146
161
|
operationId?: string;
|
|
147
162
|
tools?: RuntimeToolDefinition[];
|
|
163
|
+
toolChoice?: RuntimeToolChoice;
|
|
148
164
|
contexts?: RuntimeContext[];
|
|
149
165
|
resources?: RuntimeResourceRef[];
|
|
150
166
|
sessionResources?: RuntimeResource[];
|
|
@@ -1390,4 +1406,4 @@ declare class VercelEmbeddingProvider implements EmbeddingProvider {
|
|
|
1390
1406
|
private redact;
|
|
1391
1407
|
}
|
|
1392
1408
|
|
|
1393
|
-
export { type ActiveRuntimeWork, type ActiveRuntimeWorkKind, type ActiveStream, type ActiveWorkTracker, type AgentExecutionMode, type AgentIdResolver, type AiFeatureRuntimeState, type AuthMode, type BillingMode, type BridgeSessionResource, type ChatRuntimeBridge, type ChatRuntimeBridgeConfig, type ConversationDetail, type ConversationInfo, type ConversationPage, type ConversationPatch, type ConversationStore, type CreateConversationInput, EMPTY_CAPABILITIES, type EditorOutputContext, type EmbeddingModelChangeEvent, type EmbeddingProvider, type EmbeddingProviderConfig, type EmbeddingSession, type ExecutionTarget, type GetConversationInput, type HistoryLocation, type InsertOutputData, type ListConversationsInput, MockSanqianSdk, type MockScenario, type MockSdkConfig, type OutputOperation, type OutputOperationType, type OutputOperationsManager, type PendingOutputOps, type PendingPermission, type PermissionDecision, type PermissionGate, type PermissionPolicy, type ProviderChangedEvent, type ProviderInstanceConfig, type RerankInput, type RerankProvider, type RerankResult, type RerankResultItem, type ResourceListPage, type ResourceListRequest, type ResourceProviderInfo, type RuntimeAgentConfig, type RuntimeAgentId, type RuntimeAgentRegistry, type RuntimeChatRequest, type RuntimeChatResponse, type RuntimeChatStreamRequest, type RuntimeConnectionErrorCode, type RuntimeConnectionSnapshot, type RuntimeConnectionStatus, type RuntimeContext, type RuntimeConversationMessage, type RuntimeHitlResponse, type RuntimeInterrupt, type RuntimeMessage, type RuntimePermissionResponse, type RuntimeProfile, type RuntimeProvider, type RuntimeProviderCapabilities, type RuntimeProviderDescriptor, type RuntimeProviderKind, type RuntimeResource, type RuntimeResourceRef, type RuntimeSecretStore, type RuntimeSessionManager, type RuntimeSessionResourceEvent, type RuntimeStreamEvent, type RuntimeTaskPipeline, type RuntimeTaskPipelineInput, type RuntimeToolCall, type RuntimeToolDefinition, type RuntimeToolExecutionContext, type RuntimeToolExecutionInput, type RuntimeToolExecutionMetadata, type RuntimeToolExecutionResult, type RuntimeToolHandler, type RuntimeToolMetadata, type RuntimeToolRegistration, type RuntimeToolRegistry, type RuntimeUsage, type SanqianEmbeddingConfig, SanqianEmbeddingProvider, SanqianProvider, type SanqianProviderConfig, type SanqianRerankConfig, SanqianRerankProvider, type SanqianSdkPort, type SecretDescriptor, type SecretRef, type StoreSecretInput, type SwitchOptions, type SwitchResult, type ToolCategory, type VercelEmbeddingConfig, VercelEmbeddingProvider, VercelProvider, type VercelProviderConfig, convertSdkStreamEvent, convertToolsForVercel, createActiveWorkTracker, createCategoryPermissionPolicy, createChatRuntimeBridge, createDefaultPermissionPolicy, createDisabledState, createEmbeddingSession, createMemoryConversationStore, createMemorySecretStore, createOutputOperationsManager, createPermissionGate, createSanqianAgentIdResolver, createSessionManager, createTaskPipeline, createToolRegistry, redactToolError, resolveAiFeaturesFromRuntime, validateOutputContent };
|
|
1409
|
+
export { type ActiveRuntimeWork, type ActiveRuntimeWorkKind, type ActiveStream, type ActiveWorkTracker, type AgentExecutionMode, type AgentIdResolver, type AiFeatureRuntimeState, type AuthMode, type BillingMode, type BridgeSessionResource, type ChatRuntimeBridge, type ChatRuntimeBridgeConfig, type ConversationDetail, type ConversationInfo, type ConversationPage, type ConversationPatch, type ConversationStore, type CreateConversationInput, EMPTY_CAPABILITIES, type EditorOutputContext, type EmbeddingModelChangeEvent, type EmbeddingProvider, type EmbeddingProviderConfig, type EmbeddingSession, type ExecutionTarget, type GetConversationInput, type HistoryLocation, type InsertOutputData, type ListConversationsInput, MockSanqianSdk, type MockScenario, type MockSdkConfig, type OutputOperation, type OutputOperationType, type OutputOperationsManager, type PendingOutputOps, type PendingPermission, type PermissionDecision, type PermissionGate, type PermissionPolicy, type ProviderChangedEvent, type ProviderInstanceConfig, type RerankInput, type RerankProvider, type RerankResult, type RerankResultItem, type ResourceListPage, type ResourceListRequest, type ResourceProviderInfo, type RuntimeAgentConfig, type RuntimeAgentId, type RuntimeAgentRegistry, type RuntimeChatRequest, type RuntimeChatResponse, type RuntimeChatStreamRequest, type RuntimeConnectionErrorCode, type RuntimeConnectionSnapshot, type RuntimeConnectionStatus, type RuntimeContext, type RuntimeConversationMessage, type RuntimeHitlResponse, type RuntimeInterrupt, type RuntimeMessage, type RuntimePermissionResponse, type RuntimeProfile, type RuntimeProvider, type RuntimeProviderCapabilities, type RuntimeProviderDescriptor, type RuntimeProviderKind, type RuntimeResource, type RuntimeResourceRef, type RuntimeSecretStore, type RuntimeSessionManager, type RuntimeSessionResourceEvent, type RuntimeStreamEvent, type RuntimeTaskPipeline, type RuntimeTaskPipelineInput, type RuntimeToolCall, type RuntimeToolChoice, type RuntimeToolDefinition, type RuntimeToolExecutionContext, type RuntimeToolExecutionInput, type RuntimeToolExecutionMetadata, type RuntimeToolExecutionResult, type RuntimeToolHandler, type RuntimeToolMetadata, type RuntimeToolRegistration, type RuntimeToolRegistry, type RuntimeUsage, type SanqianEmbeddingConfig, SanqianEmbeddingProvider, SanqianProvider, type SanqianProviderConfig, type SanqianRerankConfig, SanqianRerankProvider, type SanqianSdkPort, type SecretDescriptor, type SecretRef, type StoreSecretInput, type SwitchOptions, type SwitchResult, type ToolCategory, type VercelEmbeddingConfig, VercelEmbeddingProvider, VercelProvider, type VercelProviderConfig, convertSdkStreamEvent, convertToolsForVercel, createActiveWorkTracker, createCategoryPermissionPolicy, createChatRuntimeBridge, createDefaultPermissionPolicy, createDisabledState, createEmbeddingSession, createMemoryConversationStore, createMemorySecretStore, createOutputOperationsManager, createPermissionGate, createSanqianAgentIdResolver, createSessionManager, createTaskPipeline, createToolRegistry, redactToolError, resolveAiFeaturesFromRuntime, validateOutputContent };
|
package/dist/index.d.ts
CHANGED
|
@@ -120,6 +120,20 @@ interface RuntimeConnectionSnapshot {
|
|
|
120
120
|
errorCode?: RuntimeConnectionErrorCode;
|
|
121
121
|
lastChangedAt: number;
|
|
122
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* Per-request tool-choice constraint (mirrors Vercel AI SDK / OpenAI semantics).
|
|
125
|
+
* - 'auto' (default): the model decides whether to call tools.
|
|
126
|
+
* - 'none': the model must not call tools.
|
|
127
|
+
* - 'required': the model MUST call at least one tool this turn.
|
|
128
|
+
* - { type: 'tool', toolName }: the model MUST call the named tool.
|
|
129
|
+
* Providers that cannot honor a constraining value MUST throw instead of silently
|
|
130
|
+
* degrading to 'auto' — callers rely on this for command-style requests where a
|
|
131
|
+
* hallucinated "done" without a tool call is a correctness bug.
|
|
132
|
+
*/
|
|
133
|
+
type RuntimeToolChoice = 'auto' | 'none' | 'required' | {
|
|
134
|
+
type: 'tool';
|
|
135
|
+
toolName: string;
|
|
136
|
+
};
|
|
123
137
|
interface RuntimeChatRequest {
|
|
124
138
|
agentId: string;
|
|
125
139
|
messages: RuntimeMessage[];
|
|
@@ -127,6 +141,7 @@ interface RuntimeChatRequest {
|
|
|
127
141
|
providerInstanceId?: string;
|
|
128
142
|
operationId?: string;
|
|
129
143
|
tools?: RuntimeToolDefinition[];
|
|
144
|
+
toolChoice?: RuntimeToolChoice;
|
|
130
145
|
contexts?: RuntimeContext[];
|
|
131
146
|
resources?: RuntimeResourceRef[];
|
|
132
147
|
sessionResources?: RuntimeResource[];
|
|
@@ -145,6 +160,7 @@ interface RuntimeChatStreamRequest {
|
|
|
145
160
|
providerInstanceId?: string;
|
|
146
161
|
operationId?: string;
|
|
147
162
|
tools?: RuntimeToolDefinition[];
|
|
163
|
+
toolChoice?: RuntimeToolChoice;
|
|
148
164
|
contexts?: RuntimeContext[];
|
|
149
165
|
resources?: RuntimeResourceRef[];
|
|
150
166
|
sessionResources?: RuntimeResource[];
|
|
@@ -1390,4 +1406,4 @@ declare class VercelEmbeddingProvider implements EmbeddingProvider {
|
|
|
1390
1406
|
private redact;
|
|
1391
1407
|
}
|
|
1392
1408
|
|
|
1393
|
-
export { type ActiveRuntimeWork, type ActiveRuntimeWorkKind, type ActiveStream, type ActiveWorkTracker, type AgentExecutionMode, type AgentIdResolver, type AiFeatureRuntimeState, type AuthMode, type BillingMode, type BridgeSessionResource, type ChatRuntimeBridge, type ChatRuntimeBridgeConfig, type ConversationDetail, type ConversationInfo, type ConversationPage, type ConversationPatch, type ConversationStore, type CreateConversationInput, EMPTY_CAPABILITIES, type EditorOutputContext, type EmbeddingModelChangeEvent, type EmbeddingProvider, type EmbeddingProviderConfig, type EmbeddingSession, type ExecutionTarget, type GetConversationInput, type HistoryLocation, type InsertOutputData, type ListConversationsInput, MockSanqianSdk, type MockScenario, type MockSdkConfig, type OutputOperation, type OutputOperationType, type OutputOperationsManager, type PendingOutputOps, type PendingPermission, type PermissionDecision, type PermissionGate, type PermissionPolicy, type ProviderChangedEvent, type ProviderInstanceConfig, type RerankInput, type RerankProvider, type RerankResult, type RerankResultItem, type ResourceListPage, type ResourceListRequest, type ResourceProviderInfo, type RuntimeAgentConfig, type RuntimeAgentId, type RuntimeAgentRegistry, type RuntimeChatRequest, type RuntimeChatResponse, type RuntimeChatStreamRequest, type RuntimeConnectionErrorCode, type RuntimeConnectionSnapshot, type RuntimeConnectionStatus, type RuntimeContext, type RuntimeConversationMessage, type RuntimeHitlResponse, type RuntimeInterrupt, type RuntimeMessage, type RuntimePermissionResponse, type RuntimeProfile, type RuntimeProvider, type RuntimeProviderCapabilities, type RuntimeProviderDescriptor, type RuntimeProviderKind, type RuntimeResource, type RuntimeResourceRef, type RuntimeSecretStore, type RuntimeSessionManager, type RuntimeSessionResourceEvent, type RuntimeStreamEvent, type RuntimeTaskPipeline, type RuntimeTaskPipelineInput, type RuntimeToolCall, type RuntimeToolDefinition, type RuntimeToolExecutionContext, type RuntimeToolExecutionInput, type RuntimeToolExecutionMetadata, type RuntimeToolExecutionResult, type RuntimeToolHandler, type RuntimeToolMetadata, type RuntimeToolRegistration, type RuntimeToolRegistry, type RuntimeUsage, type SanqianEmbeddingConfig, SanqianEmbeddingProvider, SanqianProvider, type SanqianProviderConfig, type SanqianRerankConfig, SanqianRerankProvider, type SanqianSdkPort, type SecretDescriptor, type SecretRef, type StoreSecretInput, type SwitchOptions, type SwitchResult, type ToolCategory, type VercelEmbeddingConfig, VercelEmbeddingProvider, VercelProvider, type VercelProviderConfig, convertSdkStreamEvent, convertToolsForVercel, createActiveWorkTracker, createCategoryPermissionPolicy, createChatRuntimeBridge, createDefaultPermissionPolicy, createDisabledState, createEmbeddingSession, createMemoryConversationStore, createMemorySecretStore, createOutputOperationsManager, createPermissionGate, createSanqianAgentIdResolver, createSessionManager, createTaskPipeline, createToolRegistry, redactToolError, resolveAiFeaturesFromRuntime, validateOutputContent };
|
|
1409
|
+
export { type ActiveRuntimeWork, type ActiveRuntimeWorkKind, type ActiveStream, type ActiveWorkTracker, type AgentExecutionMode, type AgentIdResolver, type AiFeatureRuntimeState, type AuthMode, type BillingMode, type BridgeSessionResource, type ChatRuntimeBridge, type ChatRuntimeBridgeConfig, type ConversationDetail, type ConversationInfo, type ConversationPage, type ConversationPatch, type ConversationStore, type CreateConversationInput, EMPTY_CAPABILITIES, type EditorOutputContext, type EmbeddingModelChangeEvent, type EmbeddingProvider, type EmbeddingProviderConfig, type EmbeddingSession, type ExecutionTarget, type GetConversationInput, type HistoryLocation, type InsertOutputData, type ListConversationsInput, MockSanqianSdk, type MockScenario, type MockSdkConfig, type OutputOperation, type OutputOperationType, type OutputOperationsManager, type PendingOutputOps, type PendingPermission, type PermissionDecision, type PermissionGate, type PermissionPolicy, type ProviderChangedEvent, type ProviderInstanceConfig, type RerankInput, type RerankProvider, type RerankResult, type RerankResultItem, type ResourceListPage, type ResourceListRequest, type ResourceProviderInfo, type RuntimeAgentConfig, type RuntimeAgentId, type RuntimeAgentRegistry, type RuntimeChatRequest, type RuntimeChatResponse, type RuntimeChatStreamRequest, type RuntimeConnectionErrorCode, type RuntimeConnectionSnapshot, type RuntimeConnectionStatus, type RuntimeContext, type RuntimeConversationMessage, type RuntimeHitlResponse, type RuntimeInterrupt, type RuntimeMessage, type RuntimePermissionResponse, type RuntimeProfile, type RuntimeProvider, type RuntimeProviderCapabilities, type RuntimeProviderDescriptor, type RuntimeProviderKind, type RuntimeResource, type RuntimeResourceRef, type RuntimeSecretStore, type RuntimeSessionManager, type RuntimeSessionResourceEvent, type RuntimeStreamEvent, type RuntimeTaskPipeline, type RuntimeTaskPipelineInput, type RuntimeToolCall, type RuntimeToolChoice, type RuntimeToolDefinition, type RuntimeToolExecutionContext, type RuntimeToolExecutionInput, type RuntimeToolExecutionMetadata, type RuntimeToolExecutionResult, type RuntimeToolHandler, type RuntimeToolMetadata, type RuntimeToolRegistration, type RuntimeToolRegistry, type RuntimeUsage, type SanqianEmbeddingConfig, SanqianEmbeddingProvider, SanqianProvider, type SanqianProviderConfig, type SanqianRerankConfig, SanqianRerankProvider, type SanqianSdkPort, type SecretDescriptor, type SecretRef, type StoreSecretInput, type SwitchOptions, type SwitchResult, type ToolCategory, type VercelEmbeddingConfig, VercelEmbeddingProvider, VercelProvider, type VercelProviderConfig, convertSdkStreamEvent, convertToolsForVercel, createActiveWorkTracker, createCategoryPermissionPolicy, createChatRuntimeBridge, createDefaultPermissionPolicy, createDisabledState, createEmbeddingSession, createMemoryConversationStore, createMemorySecretStore, createOutputOperationsManager, createPermissionGate, createSanqianAgentIdResolver, createSessionManager, createTaskPipeline, createToolRegistry, redactToolError, resolveAiFeaturesFromRuntime, validateOutputContent };
|
package/dist/index.js
CHANGED
|
@@ -958,11 +958,16 @@ function createSanqianAgentIdResolver(appName) {
|
|
|
958
958
|
}
|
|
959
959
|
|
|
960
960
|
// src/providers/sanqian/provider.ts
|
|
961
|
+
var SANQIAN_TOOL_CHOICE_UNSUPPORTED_ERROR = "SanqianProvider does not support constraining toolChoice yet: the runtime wire protocol has no tool_choice field. Fail-fast by contract - do not silently degrade to auto.";
|
|
962
|
+
function assertSupportedToolChoice(toolChoice) {
|
|
963
|
+
if (toolChoice === void 0 || toolChoice === "auto") return;
|
|
964
|
+
throw new Error(SANQIAN_TOOL_CHOICE_UNSUPPORTED_ERROR);
|
|
965
|
+
}
|
|
961
966
|
var SANQIAN_CAPABILITIES = {
|
|
962
967
|
streamingText: true,
|
|
963
968
|
reasoning: true,
|
|
964
969
|
toolCalling: true,
|
|
965
|
-
parallelToolCalls:
|
|
970
|
+
parallelToolCalls: false,
|
|
966
971
|
toolArgsStreaming: true,
|
|
967
972
|
abort: true,
|
|
968
973
|
hitl: true,
|
|
@@ -1073,6 +1078,7 @@ var SanqianProvider = class {
|
|
|
1073
1078
|
// --- Chat ---
|
|
1074
1079
|
async chat(input) {
|
|
1075
1080
|
this.ensureNotDisposed();
|
|
1081
|
+
assertSupportedToolChoice(input.toolChoice);
|
|
1076
1082
|
const agentId = await this.resolveAgentId(input.agentId);
|
|
1077
1083
|
const messages = input.messages.map((m) => ({ role: m.role, content: m.content }));
|
|
1078
1084
|
const response = await this.sdk.chat(agentId, messages, {
|
|
@@ -1090,6 +1096,7 @@ var SanqianProvider = class {
|
|
|
1090
1096
|
}
|
|
1091
1097
|
async *chatStream(input) {
|
|
1092
1098
|
this.ensureNotDisposed();
|
|
1099
|
+
assertSupportedToolChoice(input.toolChoice);
|
|
1093
1100
|
const agentId = await this.resolveAgentId(input.agentId);
|
|
1094
1101
|
const messages = input.messages.map((m) => ({ role: m.role, content: m.content }));
|
|
1095
1102
|
const stream = this.sdk.chatStream(agentId, messages, {
|
|
@@ -1719,6 +1726,16 @@ function convertToolsForVercel(tools, registry, options) {
|
|
|
1719
1726
|
}
|
|
1720
1727
|
|
|
1721
1728
|
// src/providers/vercel/provider.ts
|
|
1729
|
+
function isConstrainingToolChoice(toolChoice) {
|
|
1730
|
+
return toolChoice === "required" || typeof toolChoice === "object" && toolChoice !== null;
|
|
1731
|
+
}
|
|
1732
|
+
function resolveToolChoiceOption(toolChoice, hasTools) {
|
|
1733
|
+
if (toolChoice === void 0) return {};
|
|
1734
|
+
if (!hasTools && isConstrainingToolChoice(toolChoice)) {
|
|
1735
|
+
throw new Error("toolChoice requires at least one resolved tool for this agent");
|
|
1736
|
+
}
|
|
1737
|
+
return { toolChoice };
|
|
1738
|
+
}
|
|
1722
1739
|
var VERCEL_CAPABILITIES = {
|
|
1723
1740
|
streamingText: true,
|
|
1724
1741
|
reasoning: true,
|
|
@@ -1810,6 +1827,7 @@ var VercelProvider = class {
|
|
|
1810
1827
|
system,
|
|
1811
1828
|
messages: userMessages,
|
|
1812
1829
|
tools,
|
|
1830
|
+
...resolveToolChoiceOption(input.toolChoice, !!tools),
|
|
1813
1831
|
stopWhen: (0, import_ai.stepCountIs)(maxSteps),
|
|
1814
1832
|
abortSignal: input.signal
|
|
1815
1833
|
});
|
|
@@ -1840,11 +1858,13 @@ var VercelProvider = class {
|
|
|
1840
1858
|
try {
|
|
1841
1859
|
let completedSteps = 0;
|
|
1842
1860
|
let finishReason;
|
|
1861
|
+
const toolInputNames = /* @__PURE__ */ new Map();
|
|
1843
1862
|
const result = (0, import_ai.streamText)({
|
|
1844
1863
|
model,
|
|
1845
1864
|
system,
|
|
1846
1865
|
messages: userMessages,
|
|
1847
1866
|
tools,
|
|
1867
|
+
...resolveToolChoiceOption(input.toolChoice, !!tools),
|
|
1848
1868
|
stopWhen: (0, import_ai.stepCountIs)(maxSteps),
|
|
1849
1869
|
abortSignal: input.signal
|
|
1850
1870
|
});
|
|
@@ -1869,6 +1889,23 @@ var VercelProvider = class {
|
|
|
1869
1889
|
}
|
|
1870
1890
|
break;
|
|
1871
1891
|
}
|
|
1892
|
+
case "tool-input-start": {
|
|
1893
|
+
const startPart = part;
|
|
1894
|
+
if (startPart.id) toolInputNames.set(startPart.id, startPart.toolName ?? "");
|
|
1895
|
+
break;
|
|
1896
|
+
}
|
|
1897
|
+
case "tool-input-delta": {
|
|
1898
|
+
const deltaPart = part;
|
|
1899
|
+
if (deltaPart.id && deltaPart.delta) {
|
|
1900
|
+
yield {
|
|
1901
|
+
type: "tool_args_chunk",
|
|
1902
|
+
toolCallId: deltaPart.id,
|
|
1903
|
+
toolName: toolInputNames.get(deltaPart.id) ?? "",
|
|
1904
|
+
chunk: deltaPart.delta
|
|
1905
|
+
};
|
|
1906
|
+
}
|
|
1907
|
+
break;
|
|
1908
|
+
}
|
|
1872
1909
|
case "tool-call": {
|
|
1873
1910
|
const toolPart = part;
|
|
1874
1911
|
yield {
|
|
@@ -1919,8 +1956,7 @@ var VercelProvider = class {
|
|
|
1919
1956
|
yield { type: "error", error: this.redactSecrets(errorMessage) };
|
|
1920
1957
|
return;
|
|
1921
1958
|
}
|
|
1922
|
-
// text-start, text-end, reasoning-start, reasoning-end,
|
|
1923
|
-
// tool-input-start, tool-input-end, tool-input-delta,
|
|
1959
|
+
// text-start, text-end, reasoning-start, reasoning-end, tool-input-end,
|
|
1924
1960
|
// start-step, source, file - skip
|
|
1925
1961
|
default:
|
|
1926
1962
|
break;
|