Özel Eklentiler
Ajanlar için araçlar içeren özel eklentiler oluşturun ve kaydedin. Güvenilir Astreus agent sistemleri oluşturmak için gereken kurulum kalıplarını, API'leri...
Ajanlar için araçlar içeren özel eklentiler oluşturun ve kaydedin.
Hızlı Başlangıç
Eksiksiz Örneği Klonlayın
Başlamanın en kolay yolu, eksiksiz örnek repository'sini klonlamaktır:
git clone https://github.com/astreus-ai/examples
cd examples/custom-plugins
npm installYa da Sadece Paketi Yükleyin
Sıfırdan oluşturmayı tercih ediyorsanız:
npm install @astreus-ai/astreusOrtam Kurulumu
# .env
OPENAI_API_KEY=sk-your-openai-api-key-here
DB_URL=sqlite://./astreus.dbÖzel Hava Durumu Eklentisi
import { Agent, ToolDefinition, PluginDefinition } from '@astreus-ai/astreus';
// Define a custom tool
const weatherTool: ToolDefinition = {
name: 'get_weather',
description: 'Get current weather for a location',
parameters: {
location: {
name: 'location',
type: 'string',
description: 'City name',
required: true
},
units: {
name: 'units',
type: 'string',
description: 'Temperature units (celsius or fahrenheit)',
required: false,
enum: ['celsius', 'fahrenheit']
}
},
handler: async (params) => {
// Simulate weather API call
const weather = {
temperature: 22,
conditions: 'sunny',
location: params.location as string
};
return {
success: true,
data: weather
};
}
};
// Create plugin
const weatherPlugin: PluginDefinition = {
name: 'weather-plugin',
version: '1.0.0',
description: 'Weather information tools',
tools: [weatherTool]
};
// Create agent and register plugin
const agent = await Agent.create({
name: 'WeatherAgent',
model: 'gpt-4o'
});
await agent.registerPlugin(weatherPlugin);
// Use the plugin in conversation
const response = await agent.ask("What's the weather like in Tokyo?");
console.log(response); // Agent automatically uses the weather toolÖrneği Çalıştırma
Repository'yi klonladıysanız:
npm run devSıfırdan oluşturduysanız, yukarıdaki kodla bir index.ts dosyası oluşturun ve şunu çalıştırın:
npx tsx index.tsRepository
Eksiksiz örnek GitHub üzerinde mevcuttur: examples/custom-plugins
Son güncelleme: 6 Temmuz 2026
Bu bölümde
İlk Ajanınız
Astreus framework ile ilk yapay zeka ajanınızı oluşturun. Güvenilir Astreus agent sistemleri oluşturmak için gereken kurulum kalıplarını, API'leri ve pratik...
Belleğe Sahip Ajan
Kalıcı bellek yeteneklerine sahip ajanlar oluşturun. Güvenilir Astreus agent sistemleri oluşturmak için gereken kurulum kalıplarını, API'leri ve pratik...
Bilgi Tabanlı Ajan
Gelişmiş bilgi erişimi için bilgi tabanı yeteneklerine sahip ajanlar oluşturun. Güvenilir Astreus agent sistemleri oluşturmak için gereken kurulum...
Görsel Destekli Ajan
Görselleri işleyip analiz edebilen ajanlar oluşturun. Güvenilir Astreus agent sistemleri oluşturmak için gereken kurulum kalıplarını, API'leri ve pratik...