Skip to content

Commit ee07cb6

Browse files
committed
refactor: store llm prompts as constants for easy access
1 parent e19aae6 commit ee07cb6

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

lib/constants/constants.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export 'key_name.dart';
22
export 'link.dart';
33
export 'llm_models.dart';
4+
export 'llm_prompts.dart';
45
export 'padding.dart';

lib/constants/llm_prompts.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
abstract class LLMPromptConstants {
2+
const LLMPromptConstants();
3+
4+
static const String wordOfTheDayPrompt =
5+
'Use millisecond timestamp as nonce. Return raw '
6+
'JSON:{"word":...,"pinyin":...,"definitions":[...],'
7+
'"exampleSentences":[{"sentence":...,"pinyin":...,'
8+
'"translation":...}]}'
9+
'Pick a new advanced but common Chinese word each run';
10+
}

lib/presentation/home/repositories/word_of_the_day_repository.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,7 @@ final class WordOfTheDayRepository {
3636
DeepSeekUserMessage(
3737
// TODO: Feed with stuff from user's translation or dictionary
3838
// history
39-
uContent: 'Use millisecond timestamp as nonce. Return raw '
40-
'JSON:{"word":...,"pinyin":...,"definitions":[...],'
41-
'"exampleSentences":[{"sentence":...,"pinyin":...,'
42-
'"translation":...}]}'
43-
'Pick a new advanced but common Chinese word each run',
39+
uContent: LLMPromptConstants.wordOfTheDayPrompt,
4440
),
4541
],
4642
responseFormat: DeepSeekResponseFormat.string,

0 commit comments

Comments
 (0)