@mastra/react 0.4.1-alpha.7 → 0.4.1-alpha.8
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/CHANGELOG.md +12 -0
- package/dist/agent/hooks.d.ts +7 -1
- package/dist/agent/hooks.d.ts.map +1 -1
- package/dist/index.cjs +23 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +23 -16
- package/dist/index.js.map +1 -1
- package/package.json +6 -4
package/dist/index.js
CHANGED
|
@@ -2034,6 +2034,7 @@ var useChat = ({
|
|
|
2034
2034
|
threadId,
|
|
2035
2035
|
initialMessages,
|
|
2036
2036
|
requestContext: propsRequestContext,
|
|
2037
|
+
clientTools: hookClientTools,
|
|
2037
2038
|
onSignalSent,
|
|
2038
2039
|
onSignalEcho,
|
|
2039
2040
|
onThreadSignalsUnsupported,
|
|
@@ -2227,6 +2228,7 @@ var useChat = ({
|
|
|
2227
2228
|
requireToolApproval
|
|
2228
2229
|
} = modelSettings || {};
|
|
2229
2230
|
const resolvedRequestContext = requestContext ?? propsRequestContext;
|
|
2231
|
+
const resolvedClientTools = clientTools ?? hookClientTools;
|
|
2230
2232
|
_requestContext.current = resolvedRequestContext;
|
|
2231
2233
|
setIsRunning(true);
|
|
2232
2234
|
const clientWithAbort = new MastraClient({
|
|
@@ -2254,7 +2256,7 @@ var useChat = ({
|
|
|
2254
2256
|
providerOptions,
|
|
2255
2257
|
tracingOptions,
|
|
2256
2258
|
requireToolApproval,
|
|
2257
|
-
clientTools
|
|
2259
|
+
clientTools: resolvedClientTools
|
|
2258
2260
|
});
|
|
2259
2261
|
if (response.finishReason === "suspended" && response.suspendPayload) {
|
|
2260
2262
|
const { toolCallId, toolName, args } = response.suspendPayload;
|
|
@@ -2314,6 +2316,23 @@ var useChat = ({
|
|
|
2314
2316
|
requireToolApproval
|
|
2315
2317
|
} = modelSettings || {};
|
|
2316
2318
|
const resolvedRequestContext = requestContext ?? propsRequestContext;
|
|
2319
|
+
const resolvedClientTools = clientTools ?? hookClientTools;
|
|
2320
|
+
const signalContinuationOptions = {
|
|
2321
|
+
maxSteps,
|
|
2322
|
+
modelSettings: {
|
|
2323
|
+
frequencyPenalty,
|
|
2324
|
+
presencePenalty,
|
|
2325
|
+
maxRetries,
|
|
2326
|
+
maxOutputTokens: maxTokens,
|
|
2327
|
+
temperature,
|
|
2328
|
+
topK,
|
|
2329
|
+
topP
|
|
2330
|
+
},
|
|
2331
|
+
instructions,
|
|
2332
|
+
providerOptions,
|
|
2333
|
+
requireToolApproval,
|
|
2334
|
+
tracingOptions
|
|
2335
|
+
};
|
|
2317
2336
|
_requestContext.current = resolvedRequestContext;
|
|
2318
2337
|
setIsRunning(true);
|
|
2319
2338
|
_streamAbortRef.current?.abort();
|
|
@@ -2348,7 +2367,7 @@ var useChat = ({
|
|
|
2348
2367
|
providerOptions,
|
|
2349
2368
|
requireToolApproval,
|
|
2350
2369
|
tracingOptions,
|
|
2351
|
-
clientTools
|
|
2370
|
+
clientTools: resolvedClientTools
|
|
2352
2371
|
});
|
|
2353
2372
|
_onChunk.current = onChunk;
|
|
2354
2373
|
_currentRunId.current = runId;
|
|
@@ -2383,21 +2402,9 @@ var useChat = ({
|
|
|
2383
2402
|
threadId: threadId2,
|
|
2384
2403
|
ifIdle: {
|
|
2385
2404
|
streamOptions: {
|
|
2386
|
-
|
|
2387
|
-
modelSettings: {
|
|
2388
|
-
frequencyPenalty,
|
|
2389
|
-
presencePenalty,
|
|
2390
|
-
maxRetries,
|
|
2391
|
-
maxOutputTokens: maxTokens,
|
|
2392
|
-
temperature,
|
|
2393
|
-
topK,
|
|
2394
|
-
topP
|
|
2395
|
-
},
|
|
2396
|
-
instructions,
|
|
2405
|
+
...signalContinuationOptions,
|
|
2397
2406
|
requestContext: resolvedRequestContext,
|
|
2398
|
-
|
|
2399
|
-
requireToolApproval,
|
|
2400
|
-
tracingOptions
|
|
2407
|
+
clientTools: resolvedClientTools
|
|
2401
2408
|
}
|
|
2402
2409
|
}
|
|
2403
2410
|
});
|