- Add intelligent-router.sh hook for automatic agent routing - Add AUTO-TRIGGER-SUMMARY.md documentation - Add FINAL-INTEGRATION-SUMMARY.md documentation - Complete Prometheus integration (6 commands + 4 tools) - Complete Dexto integration (12 commands + 5 tools) - Enhanced Ralph with access to all agents - Fix /clawd command (removed disable-model-invocation) - Update hooks.json to v5 with intelligent routing - 291 total skills now available - All 21 commands with automatic routing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
44 lines
1.3 KiB
TypeScript
44 lines
1.3 KiB
TypeScript
/**
|
|
* Basic Dexto Agent SDK Example
|
|
*
|
|
* This example demonstrates the simplest way to use the Dexto Agent SDK
|
|
* to create an AI agent and have a conversation.
|
|
*
|
|
* Run with: npx tsx examples/basic-agent-example.ts
|
|
*/
|
|
import 'dotenv/config';
|
|
import { DextoAgent } from '@dexto/core';
|
|
|
|
// Create agent with minimal configuration
|
|
const agent = new DextoAgent({
|
|
systemPrompt: 'You are a helpful AI assistant.',
|
|
llm: {
|
|
provider: 'openai',
|
|
model: 'gpt-5-mini',
|
|
apiKey: process.env.OPENAI_API_KEY || '',
|
|
},
|
|
});
|
|
|
|
await agent.start();
|
|
|
|
// Create a session for the conversation
|
|
const session = await agent.createSession();
|
|
|
|
// Use generate() for simple request/response
|
|
console.log('Asking a question...\n');
|
|
const response = await agent.generate('What is TypeScript and why is it useful?', session.id);
|
|
console.log(response.content);
|
|
console.log(`\n(Used ${response.usage.totalTokens} tokens)\n`);
|
|
|
|
// Conversations maintain context within a session
|
|
console.log('---\nAsking for a haiku...\n');
|
|
const haiku = await agent.generate('Write a haiku about TypeScript', session.id);
|
|
console.log(haiku.content);
|
|
|
|
console.log('\n---\nAsking to make it funnier...\n');
|
|
const funnier = await agent.generate('Make it funnier', session.id);
|
|
console.log(funnier.content);
|
|
|
|
await agent.stop();
|
|
console.log('\n✅ Done!');
|