Skip to content

Commit 9089179

Browse files
committed
Add consts.dart
1 parent 65ba7ab commit 9089179

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

lib/dashbot/consts.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
const kModel = 'llama3.2:3b';
2+
const kOllamaEndpoint = 'http://127.0.0.1:11434/api';

lib/dashbot/features/general_query.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:ollama_dart/ollama_dart.dart';
22
import '../../models/models.dart';
3+
import '../consts.dart';
34

45
class GeneralQueryFeature {
56
final OllamaClient _client;
@@ -44,7 +45,7 @@ Respond in a helpful, direct manner that specifically answers what was asked.
4445

4546
final response = await _client.generateCompletion(
4647
request: GenerateCompletionRequest(
47-
model: 'llama3.2:3b',
48+
model: kModel,
4849
prompt: enhancedPrompt,
4950
),
5051
);

lib/dashbot/services/dashbot_service.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:ollama_dart/ollama_dart.dart';
22
import 'package:apidash/models/request_model.dart';
3+
import '../consts.dart';
34
import '../features/features.dart';
45

56
class DashBotService {
@@ -11,9 +12,9 @@ class DashBotService {
1112
final GeneralQueryFeature _generalQueryFeature;
1213

1314
DashBotService()
14-
: _client = OllamaClient(baseUrl: 'http://127.0.0.1:11434/api'),
15-
_generalQueryFeature = GeneralQueryFeature(
16-
OllamaClient(baseUrl: 'http://127.0.0.1:11434/api')) {
15+
: _client = OllamaClient(baseUrl: kOllamaEndpoint),
16+
_generalQueryFeature =
17+
GeneralQueryFeature(OllamaClient(baseUrl: kOllamaEndpoint)) {
1718
_explainFeature = ExplainFeature(this);
1819
_debugFeature = DebugFeature(this);
1920
_documentationFeature = DocumentationFeature(this);

0 commit comments

Comments
 (0)