Skip to content

Commit

Permalink
check localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
danemadsen committed Apr 24, 2024
1 parent 679df8c commit acd299a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/classes/ollama_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ class OllamaModel extends LargeLanguageModel {

@override
Future<void> resetUri() async {
// Check Localhost
if ((await _checkIpForOllama('127.0.0.1')).isNotEmpty) {
uri = 'http://127.0.0.1:11434';
notifyListeners();
return;
}

// If ip is set, check if it's valid
if (_ip.isNotEmpty && (await _checkIpForOllama(_ip)).isNotEmpty) {
uri = 'http://$_ip:11434';
notifyListeners();
Expand Down

0 comments on commit acd299a

Please sign in to comment.