Update app.py
Browse files
app.py
CHANGED
|
@@ -49,11 +49,15 @@ def record_text(audio_file,api_key):
|
|
| 49 |
|
| 50 |
def api_calling(audio_file, prompt, api_key):
|
| 51 |
audio_text = record_text(audio_file,api_key)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
if len(prompt) == 0:
|
| 53 |
prompt = '''Hi, act as a content writer and from the transcript provided to you separate all the text.
|
| 54 |
Apply proper punctuations, upper case and lower case to the provided text.'''
|
| 55 |
|
| 56 |
-
return
|
| 57 |
else:
|
| 58 |
headers = {
|
| 59 |
"Content-Type": "application/json",
|
|
|
|
| 49 |
|
| 50 |
def api_calling(audio_file, prompt, api_key):
|
| 51 |
audio_text = record_text(audio_file,api_key)
|
| 52 |
+
sp_txt = audio_text.split("\n")
|
| 53 |
+
new_lst = ''
|
| 54 |
+
for i in range(2,len(sp_txt),4):
|
| 55 |
+
new_lst = new_lst + ' ' + sp_txt[i]
|
| 56 |
if len(prompt) == 0:
|
| 57 |
prompt = '''Hi, act as a content writer and from the transcript provided to you separate all the text.
|
| 58 |
Apply proper punctuations, upper case and lower case to the provided text.'''
|
| 59 |
|
| 60 |
+
return new_lst
|
| 61 |
else:
|
| 62 |
headers = {
|
| 63 |
"Content-Type": "application/json",
|