File tree Expand file tree Collapse file tree 1 file changed +1
-6
lines changed
python-realtimespeech-selectai/src Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -144,21 +144,17 @@ def executeSelectAI():
144
144
145
145
try :
146
146
with connection .cursor () as cursor :
147
- # Execute AI query
148
147
cursor .execute (query , prompt = cummulativeResult )
149
148
result = cursor .fetchone ()
150
-
151
149
if result and isinstance (result [0 ], oracledb .LOB ):
152
150
text_result = result [0 ].read ()
153
151
print (text_result )
154
152
155
- # Update the global variables
156
153
latest_thetime = datetime .now ()
157
154
latest_question = cummulativeResult
158
155
latest_answer = text_result [:3000 ] # Truncate if necessary
159
156
cummulativeResult = ""
160
157
161
- # Insert the prompt and result into the table if isInsertResults is True
162
158
if isInsertResults :
163
159
insert_query = """
164
160
INSERT INTO selectai_data (thetime, question, answer)
@@ -176,7 +172,6 @@ def executeSelectAI():
176
172
except Exception as e :
177
173
print (f"An error occurred: { e } " )
178
174
179
- # Reset cumulativeResult after execution
180
175
cummulativeResult = ""
181
176
182
177
async def handle_request (request ):
@@ -233,4 +228,4 @@ def message_callback(message):
233
228
if stream .is_active ():
234
229
stream .close ()
235
230
236
- print ("Closed now " )
231
+ print ("Closed" )
You can’t perform that action at this time.
0 commit comments