diff --git a/demo/html/script.js b/demo/html/script.js
index 0d29d99..1a75634 100644
--- a/demo/html/script.js
+++ b/demo/html/script.js
@@ -6,7 +6,7 @@ document.addEventListener('DOMContentLoaded', () => {
lang: 'en-US', // Set the language
transcription: {
provider: 'default',
- apiKey: 'sk-proj-'
+ apiKey: ''
},
recognition: {
provider: 'openai',
diff --git a/src/nlu/recognition/openai-driver.ts b/src/nlu/recognition/openai-driver.ts
index 72cac3e..57e2a76 100644
--- a/src/nlu/recognition/openai-driver.ts
+++ b/src/nlu/recognition/openai-driver.ts
@@ -435,101 +435,6 @@ export class OpenAIRecognitionDriver implements RecognitionDriver {
return systemPrompt;
}
- private buildLanguageInstruction(): string {
- return this.language !== OpenAIRecognitionDriver.DEFAULT_LANGUAGE
- ? `The user input will be in ${this.getLanguageName(this.language)}. You should understand the meaning of the input in that language and match it to the appropriate English command intents listed below. Focus on the semantic meaning rather than exact word matching.\n\n`
- : '';
- }
-
- private buildIntentCategories(): string {
- const validIntents = this.availableIntents.filter(i => i !== IntentTypes.UNKNOWN);
- return `You have access to the following intent categories: ${validIntents.join(', ')}.`;
- }
-
- private buildEntityInstructions(): string {
- let instructions = '\nFor each intent category, here are the types of entities you should look for:\n';
-
- Object.entries(this.commandRegistry).forEach(([intentName, config]) => {
- if (intentName === IntentTypes.UNKNOWN) return;
-
- instructions += `\nIntent: ${intentName}
-Expected entities: ${config.entities.join(', ')}
-Purpose: Use your understanding to determine if the user's input semantically matches this intent type for web UI interaction.`;
- });
-
- return instructions;
- }
-
- private buildMultilingualInstructions(): string {
- return this.language !== OpenAIRecognitionDriver.DEFAULT_LANGUAGE
- ? `\n\nIMPORTANT MULTILINGUAL PROCESSING:
-- The user input is in ${this.getLanguageName(this.language)}
-- Use your language understanding capabilities to interpret the semantic meaning
-- Match the meaning to the most appropriate English intent categories
-- Extract entities based on semantic understanding, not literal translation
-- Normalize target/group entities to clear English descriptions
-- Normalize directional entities to English cardinal directions (e.g., "left", "right", "up", "down")
-- Normalize numeric, date, and time entities to standard English format
-- Preserve input values as-is when they represent user data`
- : '';
- }
-
- private buildClassificationInstructions(): string {
- // MODIFICATION IS HERE
- return `INSTRUCTIONS FOR INTENT CLASSIFICATION:
-You have full autonomy to interpret user commands. Use your understanding of:
-- Natural language semantics and context
-- Web UI interaction patterns
-- User intent behind different phrasings
-- Command variations and synonyms
-- Multi-step or compound commands
-
-Don't rely on exact phrase matching - use your intelligence to understand what the user wants to accomplish on a web interface.
-
-CRITICAL RULE FOR 'target' and 'group' ENTITY EXTRACTION:
-When extracting a 'target' or 'group' entity, you MUST use the most complete and descriptive noun phrase from the user's command that identifies the UI element.
-The system has its own powerful downstream matching logic. Your role is to provide it with the most accurate and verbose text possible.
-Do NOT simplify, generalize, or guess a different name for the target. Extract the text as spoken by the user.
-Example for "the preferred date is today":
-- GOOD: { "target": "preferred date" }
-- BAD: { "target": "date field" }
-Example for "click the big red save button":
-- GOOD: { "target": "big red save button" }
-- BAD: { "target": "save button" }
-
-Respond with a JSON array containing multiple intents in order of likelihood or relevance. Each intent should be a JSON object containing:
-1. "intent": The identified intent name (use "unknown" only if genuinely unclear)
-2. "confidence": A number between 0 and 1 indicating your confidence level
-3. "entities": An object with extracted entity values as key-value pairs
-
-Example response for "click the submit button and then go back":
-[
- {
- "intent": "click_element",
- "confidence": 0.95,
- "entities": {
- "target": "submit button"
- }
- },
- {
- "intent": "navigate",
- "confidence": 0.85,
- "entities": {
- "direction": "back"
- }
- }
-]
-
-Use your full language understanding capabilities to interpret user intent, even for:
-- Colloquial expressions
-- Implied actions
-- Context-dependent commands
-- Creative or unusual phrasings
-- Commands with missing explicit targets
-
-IMPORTANT: Return ONLY the raw JSON array without any markdown formatting, code blocks, or backticks. Do not wrap the JSON in \`\`\` or any other formatting.`;
- }
-
private getLanguageName(langCode: string): string {
return OpenAIRecognitionDriver.LANGUAGE_NAMES[langCode] || langCode.toUpperCase();
}