The agent was calling generate() — pure model memory — which caused Mistral to hallucinate specs for older devices (e.g. i5-1135G7 instead of i3-3120M). generateWithWebSearch() is now used so Mistral queries live sources. OllamaClientInterface gains generateWithWebSearch(); OllamaClient falls back to generate() since Ollama has no built-in search tool. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
15 lines
444 B
PHP
15 lines
444 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Infrastructure\AI;
|
|
|
|
interface OllamaClientInterface
|
|
{
|
|
public function generate(string $model, string $prompt): string;
|
|
|
|
public function generateWithImage(string $model, string $prompt, string $imagePath): string;
|
|
|
|
/** Generates with web search if the backend supports it, falls back to generate(). */
|
|
public function generateWithWebSearch(string $model, string $prompt): string;
|
|
}
|