File tree 3 files changed +6
-6
lines changed
3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -109,20 +109,20 @@ async def process_text(user_input):
109
109
110
110
@router .post ("/start_conversation" )
111
111
async def start_conversation ():
112
- global continue_conversation
112
+ global continue_conversation # noqa: F824
113
113
continue_conversation = True
114
114
conversation_thread = Thread (target = asyncio .run , args = (conversation_loop (),))
115
115
conversation_thread .start ()
116
116
return {"message" : "Conversation started" }
117
117
118
118
@router .post ("/stop_conversation" )
119
119
async def stop_conversation ():
120
- global continue_conversation
120
+ global continue_conversation # noqa: F824
121
121
continue_conversation = False
122
122
return {"message" : "Conversation stopped" }
123
123
124
124
async def conversation_loop ():
125
- global continue_conversation
125
+ global continue_conversation # noqa: F824
126
126
while continue_conversation :
127
127
user_input = await record_audio_and_transcribe ()
128
128
conversation_history .append ({"role" : "user" , "content" : user_input })
Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ async def stop_enhanced_conversation_route():
182
182
183
183
@app .post ("/clear_history" )
184
184
async def clear_history ():
185
- global conversation_history
185
+ global conversation_history # noqa: F824
186
186
conversation_history .clear () # Clear the in-memory conversation history
187
187
save_conversation_history (conversation_history ) # Save the cleared state to the file
188
188
return {"status" : "cleared" }
Original file line number Diff line number Diff line change 20
20
# Functions to get and set shared state
21
21
def get_current_character ():
22
22
"""Get the current character."""
23
- global current_character
23
+ global current_character # noqa: F824
24
24
return current_character
25
25
26
26
def set_current_character (character ):
@@ -30,7 +30,7 @@ def set_current_character(character):
30
30
31
31
def is_conversation_active ():
32
32
"""Check if a conversation is active."""
33
- global conversation_active
33
+ global conversation_active # noqa: F824
34
34
return conversation_active
35
35
36
36
def set_conversation_active (active ):
You can’t perform that action at this time.
0 commit comments