import { generateText } from "ai";
import { xai } from "@ai-sdk/xai";
// Give the agent your policy docs to reference
const docs = "Our return policy: You can return items within 30 days for a full refund.";
// Customer asks about returns
const { text } = await generateText({
model: xai("grok-3-beta"),
prompt: `Docs: ${docs} --- Based on the docs, answer: Can I return an item after 2 weeks?`,
});
console.log(text); // The agent gives an answer based on your real info
Created
July 10, 2025 13:22
-
-
Save bogdan2510/8be3f8f4a8619e5f7426606f97282f76 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment