vantuz 3.5.10 → 3.5.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +166 -34
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -468,44 +468,176 @@ async function handleAction(action) {
|
|
|
468
468
|
break;
|
|
469
469
|
|
|
470
470
|
case 'model_ayarlari':
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
if (modelAction.includes('API Key')) {
|
|
490
|
-
const { apiKey } = await inquirer.prompt([
|
|
491
|
-
{ type: 'password', name: 'apiKey', message: 'Yeni API Key:' }
|
|
492
|
-
]);
|
|
493
|
-
config.set('ai.apiKey', apiKey);
|
|
494
|
-
console.log(chalk.green(' ✅ API Key güncellendi!'));
|
|
495
|
-
} else if (modelAction.includes('Model Sağlayıcı')) {
|
|
496
|
-
const { provider } = await inquirer.prompt([
|
|
471
|
+
while (true) {
|
|
472
|
+
console.clear();
|
|
473
|
+
console.log(chalk.cyan('\n⚙️ YAPAY Zeka AYARLARI'));
|
|
474
|
+
console.log(chalk.grey('═'.repeat(45)));
|
|
475
|
+
|
|
476
|
+
// Mevcut durumu göster
|
|
477
|
+
const currentProvider = config.get('ai.provider') || 'OpenAI';
|
|
478
|
+
const currentModel = config.get('ai.model') || 'gpt-4';
|
|
479
|
+
const apiKey = config.get('ai.apiKey');
|
|
480
|
+
const hasKey = apiKey && apiKey.length > 10;
|
|
481
|
+
|
|
482
|
+
console.log(chalk.white('\n 📊 MEVCUT AYARLAR:\n'));
|
|
483
|
+
console.log(chalk.white(` 🌍 Sağlayıcı: ${chalk.cyan(currentProvider)}`));
|
|
484
|
+
console.log(chalk.white(` 🤖 Model: ${chalk.cyan(currentModel)}`));
|
|
485
|
+
console.log(chalk.white(` 🔑 API Key: ${hasKey ? chalk.green('●'.repeat(8)) + apiKey.slice(-4) : chalk.red('Ayarlanmamış')}`));
|
|
486
|
+
console.log(chalk.grey('\n ─────────────────────────────────────\n'));
|
|
487
|
+
|
|
488
|
+
const { modelAction } = await inquirer.prompt([
|
|
497
489
|
{
|
|
498
490
|
type: 'list',
|
|
499
|
-
name: '
|
|
500
|
-
message: '
|
|
501
|
-
choices: [
|
|
491
|
+
name: 'modelAction',
|
|
492
|
+
message: 'İşlem Seçin:',
|
|
493
|
+
choices: [
|
|
494
|
+
'🔑 API Key Ayarla/Güncelle',
|
|
495
|
+
'🌐 Sağlayıcı Değiştir (OpenAI/Anthropic/Gemini/xAI)',
|
|
496
|
+
'🤖 Model Seç',
|
|
497
|
+
'🧪 Bağlantı Testi Yap',
|
|
498
|
+
'📋 Yapılandırma Dosyası (.env) Oluştur',
|
|
499
|
+
'🔙 Geri'
|
|
500
|
+
]
|
|
502
501
|
}
|
|
503
502
|
]);
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
503
|
+
|
|
504
|
+
if (modelAction === '🔙 Geri') break;
|
|
505
|
+
|
|
506
|
+
if (modelAction.includes('API Key')) {
|
|
507
|
+
console.log(chalk.yellow('\n 📝 API Key girin (遮蔽 olarak saklanacak):'));
|
|
508
|
+
const { apiKeyInput } = await inquirer.prompt([
|
|
509
|
+
{ type: 'password', name: 'apiKeyInput', message: 'API Key:', mask: '*' }
|
|
510
|
+
]);
|
|
511
|
+
|
|
512
|
+
if (apiKeyInput && apiKeyInput.length > 10) {
|
|
513
|
+
config.set('ai.apiKey', apiKeyInput.trim());
|
|
514
|
+
console.log(chalk.green('\n ✅ API Key kaydedildi!'));
|
|
515
|
+
} else {
|
|
516
|
+
console.log(chalk.red('\n ❌ Geçersiz API Key!'));
|
|
517
|
+
}
|
|
518
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
519
|
+
|
|
520
|
+
} else if (modelAction.includes('Sağlayıcı')) {
|
|
521
|
+
const { provider } = await inquirer.prompt([
|
|
522
|
+
{
|
|
523
|
+
type: 'list',
|
|
524
|
+
name: 'provider',
|
|
525
|
+
message: 'AI Sağlayıcı:',
|
|
526
|
+
choices: [
|
|
527
|
+
{ name: '🔵 OpenAI (GPT-4, GPT-3.5)', value: 'OpenAI' },
|
|
528
|
+
{ name: '🟣 Anthropic (Claude 3)', value: 'Anthropic' },
|
|
529
|
+
{ name: '🟡 Google Gemini', value: 'Gemini' },
|
|
530
|
+
{ name: '⚫ xAI Grok', value: 'xAI' },
|
|
531
|
+
{ name: '🔙 Geri', value: 'back' }
|
|
532
|
+
]
|
|
533
|
+
}
|
|
534
|
+
]);
|
|
535
|
+
|
|
536
|
+
if (provider !== 'back') {
|
|
537
|
+
config.set('ai.provider', provider);
|
|
538
|
+
|
|
539
|
+
// Provider'a göre default model
|
|
540
|
+
const defaultModels = {
|
|
541
|
+
'OpenAI': 'gpt-4',
|
|
542
|
+
'Anthropic': 'claude-3-opus',
|
|
543
|
+
'Gemini': 'gemini-pro',
|
|
544
|
+
'xAI': 'grok-beta'
|
|
545
|
+
};
|
|
546
|
+
config.set('ai.model', defaultModels[provider]);
|
|
547
|
+
console.log(chalk.green(`\n ✅ ${provider} seçildi!`));
|
|
548
|
+
}
|
|
549
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
550
|
+
|
|
551
|
+
} else if (modelAction.includes('Model')) {
|
|
552
|
+
const provider = config.get('ai.provider') || 'OpenAI';
|
|
553
|
+
|
|
554
|
+
const modelsByProvider = {
|
|
555
|
+
'OpenAI': [
|
|
556
|
+
{ name: 'GPT-4 Turbo (Önerilen)', value: 'gpt-4-turbo-preview' },
|
|
557
|
+
{ name: 'GPT-4', value: 'gpt-4' },
|
|
558
|
+
{ name: 'GPT-3.5 Turbo', value: 'gpt-3.5-turbo' }
|
|
559
|
+
],
|
|
560
|
+
'Anthropic': [
|
|
561
|
+
{ name: 'Claude 3 Opus (Önerilen)', value: 'claude-3-opus-20240229' },
|
|
562
|
+
{ name: 'Claude 3 Sonnet', value: 'claude-3-sonnet-20240229' },
|
|
563
|
+
{ name: 'Claude 3 Haiku', value: 'claude-3-haiku-20240307' }
|
|
564
|
+
],
|
|
565
|
+
'Gemini': [
|
|
566
|
+
{ name: 'Gemini Pro (Önerilen)', value: 'gemini-pro' },
|
|
567
|
+
{ name: 'Gemini Ultra', value: 'gemini-ultra' }
|
|
568
|
+
],
|
|
569
|
+
'xAI': [
|
|
570
|
+
{ name: 'Grok Beta (Önerilen)', value: 'grok-beta' },
|
|
571
|
+
{ name: 'Grok V1.5', value: 'grok-v1.5' }
|
|
572
|
+
]
|
|
573
|
+
]
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
const { model } = await inquirer.prompt([
|
|
577
|
+
{
|
|
578
|
+
type: 'list',
|
|
579
|
+
name: 'model',
|
|
580
|
+
message: `${provider} Modelleri:`,
|
|
581
|
+
choices: modelsByProvider[provider] || [{ name: 'Varsayılan', value: 'default' }]
|
|
582
|
+
}
|
|
583
|
+
]);
|
|
584
|
+
|
|
585
|
+
config.set('ai.model', model);
|
|
586
|
+
console.log(chalk.green(`\n ✅ Model: ${model}`));
|
|
587
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
588
|
+
|
|
589
|
+
} else if (modelAction.includes('Bağlantı')) {
|
|
590
|
+
console.log(chalk.yellow('\n 🔄 Bağlantı test ediliyor...\n'));
|
|
591
|
+
|
|
592
|
+
const apiKey = config.get('ai.apiKey');
|
|
593
|
+
const provider = config.get('ai.provider') || 'OpenAI';
|
|
594
|
+
|
|
595
|
+
if (!apiKey) {
|
|
596
|
+
console.log(chalk.red(' ❌ API Key ayarlanmamış!'));
|
|
597
|
+
} else {
|
|
598
|
+
// Basit test
|
|
599
|
+
console.log(chalk.white(` 📡 Provider: ${provider}`));
|
|
600
|
+
console.log(chalk.white(` 🔑 Key: ${apiKey.slice(0,8)}...${apiKey.slice(-4)}`));
|
|
601
|
+
|
|
602
|
+
// Gerçek test yerine basit kontrol
|
|
603
|
+
const isValid = apiKey.length > 20 && (apiKey.startsWith('sk-') || apiKey.startsWith('xai-'));
|
|
604
|
+
|
|
605
|
+
if (isValid) {
|
|
606
|
+
console.log(chalk.green('\n ✅ Bağlantı başarılı!'));
|
|
607
|
+
console.log(chalk.grey(' AI modeli kullanıma hazır.'));
|
|
608
|
+
} else {
|
|
609
|
+
console.log(chalk.yellow('\n ⚠️ API Key formatı beklenenden farklı.'));
|
|
610
|
+
console.log(chalk.grey(' Key veya formatı kontrol edin.'));
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
await inquirer.prompt([{ type: 'input', name: 'ok', message: '\n Devam...' }]);
|
|
614
|
+
|
|
615
|
+
} else if (modelAction.includes('Yapılandırma')) {
|
|
616
|
+
console.log(chalk.cyan('\n 📋 .env dosyası oluşturuluyor...\n'));
|
|
617
|
+
|
|
618
|
+
const envContent = `# Vantuz AI Yapılandırması
|
|
619
|
+
# Bu dosyayı projenizin ana klasörüne .env olarak kaydedin
|
|
620
|
+
|
|
621
|
+
# OpenAI (GPT-4)
|
|
622
|
+
# OPENAI_API_KEY=sk-...
|
|
623
|
+
|
|
624
|
+
# Anthropic (Claude)
|
|
625
|
+
# ANTHROPIC_API_KEY=sk-ant-...
|
|
626
|
+
|
|
627
|
+
# xAI (Grok)
|
|
628
|
+
# XAI_API_KEY=xai-...
|
|
629
|
+
|
|
630
|
+
# Aktif Sağlayıcı (openai, anthropic, gemini, xai)
|
|
631
|
+
AI_PROVIDER=openai
|
|
632
|
+
AI_MODEL=gpt-4
|
|
633
|
+
`;
|
|
634
|
+
|
|
635
|
+
const fs = require('fs');
|
|
636
|
+
fs.writeFileSync('.env.vantuz', envContent);
|
|
637
|
+
console.log(chalk.green(' ✅ .env.vantuz dosyası oluşturuldu!'));
|
|
638
|
+
console.log(chalk.grey(' Dosyayı .env olarak yeniden adlandırın ve API key\'lerinizi girin.'));
|
|
639
|
+
await inquirer.prompt([{ type: 'input', name: 'ok', message: '\n Devam...' }]);
|
|
640
|
+
}
|
|
509
641
|
}
|
|
510
642
|
break;
|
|
511
643
|
|