hotelvoicechat / voice_ai.py
prasanth345's picture
Create voice_ai.py
699fe54 verified
raw
history blame
443 Bytes
import gradio as gr
import openai
openai.api_key = "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"
def voice_ai(prompt):
response = openai.Audio.transcribe("whisper-1", prompt)
return response['text']
iface = gr.Interface(
voice_ai,
gr.Audio(),
gr.Textbox(label="Voice AI Response")
)
iface.launch()