diff --git a/src/Infrastructure/AI/Agent/SpecsResearchAgent.php b/src/Infrastructure/AI/Agent/SpecsResearchAgent.php index 2e4c635..9337669 100644 --- a/src/Infrastructure/AI/Agent/SpecsResearchAgent.php +++ b/src/Infrastructure/AI/Agent/SpecsResearchAgent.php @@ -25,7 +25,7 @@ final class SpecsResearchAgent 'subject' => $subject, ]); - $result = $this->client->generate($this->model, $prompt); + $result = $this->client->generateWithWebSearch($this->model, $prompt); if ('' === trim($result)) { throw new \RuntimeException("No specifications found for model: {$modelName}"); diff --git a/src/Infrastructure/AI/OllamaClient.php b/src/Infrastructure/AI/OllamaClient.php index af97ad8..038ca12 100644 --- a/src/Infrastructure/AI/OllamaClient.php +++ b/src/Infrastructure/AI/OllamaClient.php @@ -50,4 +50,9 @@ final class OllamaClient implements OllamaClientInterface return $data['response']; } + + public function generateWithWebSearch(string $model, string $prompt): string + { + return $this->generate($model, $prompt); + } } diff --git a/src/Infrastructure/AI/OllamaClientInterface.php b/src/Infrastructure/AI/OllamaClientInterface.php index 4ff78c2..ebfb56f 100644 --- a/src/Infrastructure/AI/OllamaClientInterface.php +++ b/src/Infrastructure/AI/OllamaClientInterface.php @@ -9,4 +9,7 @@ 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; }