Files
brave-core/browser/extensions/api
Andrea a98761bc6f [ollama] Add OllamaService connection check with factory and preferences (#31568)
Add OllamaService connection check with factory and preferences

This change introduces a dedicated OllamaService for managing
communication with local Ollama instances:

- Add OllamaService with IsConnected() method to check Ollama
  availability at localhost:11434
- Add OllamaServiceFactory as ProfileKeyedServiceFactory for
  proper lifecycle management
- Add ollama.mojom interface defining kOllamaBaseUrl constant
  and OllamaService mojo interface
- Add comprehensive unit tests for connection scenarios
- Add kBraveAIChatOllamaFetchEnabled preference for user control
- Register OllamaServiceFactory in browser context initialization
- Add preference to settings_private allowlist for WebUI access
- Add browser/ai_chat/ollama directory with factory implementation
- Wire up OllamaService dependency in content/browser layer

The service performs lightweight connection checks (1KB max) to
verify Ollama availability before enabling fetch functionality.
2025-10-30 01:32:31 +00:00
..