import { tools } from "@gwizai/sdk";
import { Agent } from "ai";
import { openai } from "@ai-sdk/openai";
async function main() {
// Initialize tools (reads from ~/.gwiz/config.json or GWIZ_MCP_TOKEN env var)
const gwizTools = await tools();
// Create agent with Gmail capabilities
const agent = new Agent({
model: openai("gpt-4"),
tools: {
gmail: gwizTools,
},
});
// Use the agent
const result = await agent.generate({
messages: [
{
role: "user",
content: "When is my upcoming flight to Japan?",
},
],
});
console.log(result.text);
}
main();