@nexface/tools 0.1.21-alpha.3 → 0.1.21-alpha.4
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/definition.js +1 -0
- package/dist/react.d.ts +1 -1
- package/dist/react.js +6 -4
- package/package.json +1 -1
package/dist/definition.js
CHANGED
package/dist/react.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export interface UseAgentToolDefaultOptions<TInput = unknown, TResult = unknown>
|
|
|
40
40
|
/**
|
|
41
41
|
* @experimental
|
|
42
42
|
* @warning Experimental API. Its signature and behavior may change.
|
|
43
|
-
* @remarks JSON-compatible results retain their types
|
|
43
|
+
* @remarks Renders a successful result when referenced in the final chat reply. JSON-compatible results retain their types; void becomes null and other results are unknown.
|
|
44
44
|
* @beta
|
|
45
45
|
*/
|
|
46
46
|
_render?: (context: {
|
package/dist/react.js
CHANGED
|
@@ -56,13 +56,15 @@ function useAgentBinding(definition, execute, options) {
|
|
|
56
56
|
const runtime = useInternalToolRuntime();
|
|
57
57
|
const confirmation = options.requiresConfirmation;
|
|
58
58
|
const confirmationProtocol = Boolean(options.confirm);
|
|
59
|
-
const presentation = useMemo(() =>
|
|
60
|
-
|
|
59
|
+
const presentation = useMemo(() => {
|
|
60
|
+
if (!options._render)
|
|
61
|
+
return undefined;
|
|
62
|
+
return {
|
|
61
63
|
definition,
|
|
62
64
|
...(confirmationProtocol ? { confirmationProtocol: true } : {}),
|
|
63
65
|
render: options._render,
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
+
};
|
|
67
|
+
}, [definition, options._render, confirmationProtocol]);
|
|
66
68
|
const presentationRef = useRef(presentation);
|
|
67
69
|
useLayoutEffect(() => {
|
|
68
70
|
presentationRef.current = presentation;
|