Voice-Driven Order Processing

To use the voice input system, speak in the following format:

Example Order: "Customer 12345, John, ordered 2 coffees for $5 each."

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.


Voice Input

Customer Details

  • Name: No data
  • ID: No data
  • Email: No data

Order Details

  • Items:
    • No items yet...
  • Transaction ID: No data
  • Transaction Status: No data
  • Card Type: No data

Total Amount: $0.00