Let’s create a simple AI assistant that can help with various tasks:
Copy
// Define your agent's configurationconst agentConfig = { name: 'My Assistant', instruction: 'You are a helpful AI assistant that provides clear and concise responses.', model: 'gpt-4o-mini'};// Deploy the agentconst agent = await truffle.deployAgent(agentConfig);console.log(`Agent deployed with ID: ${agent.getId()}`);
You can easily work with previously deployed agents:
Copy
// Load an existing agentconst existingAgent = await truffle.loadAgent('agent-id');// Use the loaded agentconst result = await existingAgent.run('Hello!');