Core23 commited on
Commit
f54a7c1
1 Parent(s): d2bd8e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -10
app.py CHANGED
@@ -116,16 +116,7 @@ def generate_response(transcribed_text):
116
  },
117
  ]
118
  )
119
- #return response['choices'][0]['message']['content']
120
-
121
- # Accessing the chat completion message content; modify based on actual object structure
122
- # Assuming 'response.choices()' method returns a list of choices
123
- choices = response.choices()
124
- if choices:
125
- # Assuming each choice has a 'message' method that returns a message object with 'content' attribute
126
- return choices[0].message().content
127
- else:
128
- raise ValueError('No response choices found.')
129
 
130
  def inference(text):
131
  response = client.audio.create(
 
116
  },
117
  ]
118
  )
119
+ return response.choices[0].message.content
 
 
 
 
 
 
 
 
 
120
 
121
  def inference(text):
122
  response = client.audio.create(