-
- Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
javascriptPull requests that update javascript codePull requests that update javascript code
Description
import "./instrument"; import { generateText, streamText, tool } from "ai"; import { openai } from "@ai-sdk/openai"; import dotenv from "dotenv"; import { z } from "zod"; import * as Sentry from "@sentry/node"; dotenv.config(); async function main() { const result = await generateText({ model: openai("o1", { structuredOutputs: true }), experimental_telemetry: { functionId: "Simple Agent", recordInputs: true, recordOutputs: true, isEnabled: true, }, tools: { calculateTool: tool({ description: `Calculate the result of a math problem. Returns a number.`, parameters: z.object({ a: z.number().describe("First number"), b: z.number().describe("Second number"), }), type: "function", execute: async ({ a, b }) => { throw new Error("Not implemented"); return a + b; }, }), }, maxSteps: 2, system: `You helps users with their math problems.`, prompt: "What is 1 + 1?", }); console.log("result", result.text); } main(); Metadata
Metadata
Assignees
Labels
javascriptPull requests that update javascript codePull requests that update javascript code
Projects
Status
No status