Documentation IndexFetch the complete documentation index at: /docs/llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Provide your agent with additional capabilities
import { createOpenAICompatible } from "@ai-sdk/openai-compatible"; import { generateText, tool } from "ai"; import { z } from "zod"; const hebo = createOpenAICompatible({ name: "hebo", apiKey: process.env.HEBO_API_KEY, baseURL: "https://gateway.hebo.ai/v1", }); const result = await generateText({ model: hebo("openai/gpt-oss-20b"), prompt: "How many r's are in Strawberry?", tools: { countLetters: tool({ description: "Count letter occurrences in a word", inputSchema: z.object({ word: z.string(), letters: z.string(), }), execute: async ({ word, letters }) => { const count = [...word].filter((c) => letters.includes(c)).length; return { count }; }, }), }, }); console.log(result.toolResults[0]?.output);