import type { AthenaIntelligence } from '@athenaintel/sdk';
import { AthenaIntelligenceClient, AthenaIntelligenceError } from '@athenaintel/sdk';
async function runAgentExample() {
try {
const client = new AthenaIntelligenceClient({
apiKey: process.env.ATHENA_API_KEY,
// Optional: override baseUrl for custom environments
// baseUrl: 'https://your-custom-api.example.com',
});
// Multi-tool research request
const request: AthenaIntelligence.GeneralAgentRequest = {
config: {
enabled_tools: ['search', 'browse'],
system_prompt: 'You are a helpful research assistant. Use search and browse tools to find comprehensive information.',
model: 'gpt-4-turbo-preview',
},
messages: [
{
content: 'Research the latest developments in AI and provide a detailed summary with sources.',
role: 'user',
type: 'user',
},
],
};
console.log('Sending request to General Agent...');
const response = await client.agents.general.invoke(request);
console.log('Response received:');
console.log(JSON.stringify(response, null, 2));
} catch (error) {
if (error instanceof AthenaIntelligenceError) {
console.error(`Athena API error (${error.statusCode}): ${error.message}`);
} else {
console.error('Unexpected error:', error);
}
}
}
runAgentExample();