Skip to content

Commit f698a44

Browse files
authored
Merge pull request #671 from COS301-SE-2025/temporary
Pulling more AI prompt changes to 'deployment
2 parents 08d1281 + 83ec488 commit f698a44

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

visual-compiler/backend/core/ai/assistant.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Format your response strictly as a JSON array, without any additional text whats
102102
prompt = `You are an educational assistant for compiler construction.
103103
104104
Generate a context-free grammar for a parser that will perfectly parse the user's token stream.
105-
Do not add any empty or epsilon transitions or left recursion.
105+
Do not add any empty rules, epsilon rules or recursive rules.
106106
107107
The grammar should follow this structure:
108108
1. "variables": string of comma-separated variable names

visual-compiler/frontend/src/lib/components/main/ai-assistant.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@
203203
}
204204
205205
for (const rule of parsed.rules) {
206-
if (!('input' in rule) || !('output' in rule) || typeof rule.input !== 'string') {
206+
if (!rule.input || typeof rule.input !== 'string') {
207+
207208
console.log('Invalid rule structure:', rule);
208209
return { isValid: false };
209210
}

0 commit comments

Comments
 (0)