feat: add Gemini connection test button in config panel
probarGemini() sends a minimal prompt to gemini-1.5-flash and reports latency + trimmed response text, or the error message from the API. Mirrors the existing Whisper test button pattern. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
30fc8c0f1b
commit
13386f5b49
@@ -82,6 +82,21 @@
|
||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-emerald-500 outline-none resize-none"
|
||||
placeholder="Ej: Solo vendemos streaming. No ofrecemos juegos."></textarea>
|
||||
</div>
|
||||
<div>
|
||||
<button wire:click="probarGemini"
|
||||
class="flex items-center gap-2 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-semibold rounded-lg transition">
|
||||
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09Z" />
|
||||
</svg>
|
||||
<span wire:loading.remove wire:target="probarGemini">Probar conexión Gemini</span>
|
||||
<span wire:loading wire:target="probarGemini">Probando...</span>
|
||||
</button>
|
||||
@if($geminiResult)
|
||||
<p class="mt-2 text-sm {{ str_contains($geminiResult, '✅') ? 'text-emerald-600' : 'text-red-600' }}">
|
||||
{{ $geminiResult }}
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user