To use the voice input system, speak in the following format:
The system will record for 8 seconds and from the audio extract details such as customer ID, name, and order items to process the order.
Speech-to-Text Transcription: The transcribeWithOpenAI function converts an audio file into text using OpenAI's speech-to-text API (whisper-1 model). This text is then used for further processing.
Text Parsing and Data Extraction: The parseWithOpenAI function extracts structured data (like Customer ID, Customer Name, Ordered Items, and Total Amount) from the transcribed text using OpenAI's GPT model (gpt-4o-mini). The data is returned as a JSON object.
Text-to-Speech: The speakText function converts text into spoken audio using OpenAI's text-to-speech API (tts-1 model). The audio is then played back to the user.
Total Amount: $0.00