Explorar o código

docs: fix ts error in math examples (#18244)

gotjoshua hai 3 meses
pai
achega
86dc66eae9
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      packages/web/src/content/docs/custom-tools.mdx

+ 2 - 2
packages/web/src/content/docs/custom-tools.mdx

@@ -59,7 +59,7 @@ export const add = tool({
     b: tool.schema.number().describe("Second number"),
   },
   async execute(args) {
-    return args.a + args.b
+    return (args.a + args.b).toString()
   },
 })
 
@@ -70,7 +70,7 @@ export const multiply = tool({
     b: tool.schema.number().describe("Second number"),
   },
   async execute(args) {
-    return args.a * args.b
+    return (args.a * args.b).toString()
   },
 })
 ```