Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -33,7 +33,7 @@ def record_text(audio_file):
|
|
33 |
return (MyText)
|
34 |
|
35 |
|
36 |
-
def api_calling(
|
37 |
# audio_text = record_text(audio_file)
|
38 |
if len(prompt) == 0:
|
39 |
prompt = "Apply proper punctuations, upper case and lower case to the provided text."
|
@@ -54,7 +54,7 @@ def api_calling(audio_file, prompt, api_key):
|
|
54 |
},
|
55 |
{
|
56 |
"type": "text",
|
57 |
-
"text":
|
58 |
}
|
59 |
]
|
60 |
}
|
@@ -67,9 +67,9 @@ def api_calling(audio_file, prompt, api_key):
|
|
67 |
|
68 |
|
69 |
|
70 |
-
def message_and_history(
|
71 |
history = history or []
|
72 |
-
output_text = api_calling(
|
73 |
|
74 |
if len(input) == 0:
|
75 |
input = "Speech from the video."
|
|
|
33 |
return (MyText)
|
34 |
|
35 |
|
36 |
+
def api_calling(audio_text, prompt, api_key):
|
37 |
# audio_text = record_text(audio_file)
|
38 |
if len(prompt) == 0:
|
39 |
prompt = "Apply proper punctuations, upper case and lower case to the provided text."
|
|
|
54 |
},
|
55 |
{
|
56 |
"type": "text",
|
57 |
+
"text": audio_text
|
58 |
}
|
59 |
]
|
60 |
}
|
|
|
67 |
|
68 |
|
69 |
|
70 |
+
def message_and_history(audio_text,input, history, api_key):
|
71 |
history = history or []
|
72 |
+
output_text = api_calling(audio_text,input,api_key)
|
73 |
|
74 |
if len(input) == 0:
|
75 |
input = "Speech from the video."
|