feat(ai): integrar Ollama en AiConfig para ia_controller, query_runner y landing
- Agrega provider 'ollama' al panel de AiConfig con badge azul y hint de URL - ia_controller: reemplaza webhook n8n hardcodeado por llamada directa a Ollama vía AiConfig (módulo 'ia') - query_runner: agrega soporte explícito de ollama (model fallback gemma3:1b, Basic Auth para URL pública) - HTML: agrega módulo 'IA / vCard' en el selector de módulos Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
fa269cabf1
commit
6062f31c70
@@ -73,9 +73,10 @@
|
||||
<span class="px-2 py-0.5 rounded-full text-xs font-semibold"
|
||||
:class="{
|
||||
'bg-blue-100 text-blue-700': m.trim() === 'landing',
|
||||
'bg-[#e9f0cf] text-[#5a7a1e]': m.trim() === 'query_runner'
|
||||
'bg-[#e9f0cf] text-[#5a7a1e]': m.trim() === 'query_runner',
|
||||
'bg-purple-100 text-purple-700': m.trim() === 'ia'
|
||||
}"
|
||||
x-text="m.trim() === 'landing' ? 'Landing' : m.trim() === 'query_runner' ? 'Query Runner' : m.trim()">
|
||||
x-text="m.trim() === 'landing' ? 'Landing' : m.trim() === 'query_runner' ? 'Query Runner' : m.trim() === 'ia' ? 'IA / vCard' : m.trim()">
|
||||
</span>
|
||||
</template>
|
||||
</div>
|
||||
@@ -87,7 +88,8 @@
|
||||
'bg-purple-100 text-purple-700': item.provider === 'qwen',
|
||||
'bg-green-100 text-green-700': item.provider === 'openai',
|
||||
'bg-orange-100 text-orange-700': item.provider === 'anthropic',
|
||||
'bg-gray-100 text-gray-700': !['qwen','openai','anthropic'].includes(item.provider)
|
||||
'bg-blue-100 text-blue-700': item.provider === 'ollama',
|
||||
'bg-gray-100 text-gray-700': !['qwen','openai','anthropic','ollama'].includes(item.provider)
|
||||
}" x-text="item.provider"></span>
|
||||
</td>
|
||||
<td class="py-2 px-3 text-gray-500 font-mono text-xs" x-text="item.model_name || '—'"></td>
|
||||
@@ -143,6 +145,7 @@
|
||||
<option value="openai">OpenAI</option>
|
||||
<option value="anthropic">Anthropic</option>
|
||||
<option value="groq">Groq</option>
|
||||
<option value="ollama">Ollama (local)</option>
|
||||
<option value="otro">Otro</option>
|
||||
</select>
|
||||
</div>
|
||||
@@ -164,10 +167,16 @@
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">Base URL <span class="text-gray-400">(opcional — dejar vacío para usar el default del provider)</span></label>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">Base URL
|
||||
<span x-show="form.provider !== 'ollama'" class="text-gray-400">(opcional — dejar vacío para usar el default del provider)</span>
|
||||
<span x-show="form.provider === 'ollama'" class="text-blue-500">* requerido — incluir /v1 al final</span>
|
||||
</label>
|
||||
<input x-model="form.base_url" type="url"
|
||||
placeholder="https://dashscope.aliyuncs.com/compatible-mode/v1"
|
||||
:placeholder="form.provider === 'ollama' ? 'http://10.0.1.15:11434/v1' : 'https://dashscope.aliyuncs.com/compatible-mode/v1'"
|
||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-[#8eb02f]" />
|
||||
<p x-show="form.provider === 'ollama'" x-cloak class="text-[10px] text-blue-500 mt-1">
|
||||
Interna (red Coolify): <code>http://10.0.1.15:11434/v1</code> — Pública: <code>https://ollama.u-s.app/v1</code>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@@ -258,6 +267,7 @@ function aiConfigApp() {
|
||||
moduleOptions: [
|
||||
{ value: 'landing', label: 'Landing Generator' },
|
||||
{ value: 'query_runner', label: 'Query Runner SQL' },
|
||||
{ value: 'ia', label: 'IA / vCard' },
|
||||
],
|
||||
|
||||
async init() { await this.load() },
|
||||
|
||||
Reference in New Issue
Block a user