Skip to content

Commit 7f1a8c6

Browse files
authored
chore(simple_chat): fix instruction formatting (#326)
Fixes a grammatical typo in the prompt of the simple_chat example app. Also reformats part of the instruction as a single line, avoiding hard line wraps and indentations in the middle of sentences. This might have negligible effect on LLM output, but I figure this is a very cheap improvement to make.
1 parent 4e42747 commit 7f1a8c6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

examples/simple_chat/lib/main.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ class _ChatScreenState extends State<ChatScreen> {
4848
@override
4949
void initState() {
5050
super.initState();
51-
const instruction = '''
52-
You are a helpful assistant who chats with user,
53-
giving exactly one response for each user message.
54-
Your responses should contain acknowledgment
55-
of the user message.
56-
''';
5751
final catalog = CoreCatalogItems.asCatalog();
5852
_genUiManager = GenUiManager(catalog: catalog);
5953
final aiClient = FirebaseAiClient(
60-
systemInstruction: '$instruction\n\n${GenUiPromptFragments.basicChat}',
54+
systemInstruction:
55+
'You are a helpful assistant who chats with a user, '
56+
'giving exactly one response for each user message. '
57+
'Your responses should contain acknowledgment '
58+
'of the user message.'
59+
'\n\n'
60+
'${GenUiPromptFragments.basicChat}',
6161
tools: _genUiManager.getTools(),
6262
);
6363
_uiAgent = UiAgent(

0 commit comments

Comments
 (0)