@@ -66,17 +66,17 @@ def __init__(self, *args, **kwargs):
66
66
67
67
# validate will set these:
68
68
self .openai : OpenAi | None = None
69
- self .mistral : OpenAi | None = None
70
- self .groq : OpenAi | None = None
71
- self .cerebras : OpenAi | None = None
72
- self .openrouter : OpenAi | None = None
69
+ self .mistral : OpenAi | None = None
70
+ self .groq : OpenAi | None = None
71
+ self .cerebras : OpenAi | None = None
72
+ self .openrouter : OpenAi | None = None
73
73
self .openrouter_model_supports_tools = False
74
- self .local_llm : OpenAi | None = None
75
- self .openai_azure : OpenAiAzure | None = None
76
- self .elevenlabs : ElevenLabs | None = None
77
- self .wingman_pro : WingmanPro | None = None
78
- self .google : GoogleGenAI | None = None
79
- self .perplexity : OpenAi | None = None
74
+ self .local_llm : OpenAi | None = None
75
+ self .openai_azure : OpenAiAzure | None = None
76
+ self .elevenlabs : ElevenLabs | None = None
77
+ self .wingman_pro : WingmanPro | None = None
78
+ self .google : GoogleGenAI | None = None
79
+ self .perplexity : OpenAi | None = None
80
80
81
81
# tool queue
82
82
self .pending_tool_calls = []
@@ -556,14 +556,16 @@ async def _transcribe(self, audio_input_wav: str) -> str | None:
556
556
)
557
557
printr .print (traceback .format_exc (), color = LogType .ERROR , server_only = True )
558
558
559
- if not transcript :
560
- return None
561
-
562
- # Wingman Pro might returns a serialized dict instead of a real Azure Speech transcription object
563
- if isinstance (transcript , dict ):
564
- return transcript .get ("_text" )
559
+ result = None
560
+ if transcript :
561
+ # Wingman Pro might returns a serialized dict instead of a real Azure Speech transcription object
562
+ result = (
563
+ transcript .get ("_text" )
564
+ if isinstance (transcript , dict )
565
+ else transcript .text
566
+ )
565
567
566
- return transcript . text
568
+ return result
567
569
568
570
async def _get_response_for_transcript (
569
571
self , transcript : str , benchmark : Benchmark
@@ -588,7 +590,9 @@ async def _get_response_for_transcript(
588
590
if instant_response :
589
591
await self .add_assistant_message (instant_response )
590
592
benchmark .finish_snapshot ()
591
- if instant_response == '.' : # thats for the "The UI should not give a response" option in commands
593
+ if (
594
+ instant_response == "."
595
+ ): # thats for the "The UI should not give a response" option in commands
592
596
instant_response = None
593
597
return instant_response , instant_response , None , True
594
598
benchmark .finish_snapshot ()
@@ -896,7 +900,8 @@ async def add_forced_assistant_command_calls(self, commands: list[CommandConfig]
896
900
if (
897
901
self .config .features .conversation_provider == ConversationProvider .OPENAI
898
902
) or (
899
- self .config .features .conversation_provider == ConversationProvider .WINGMAN_PRO
903
+ self .config .features .conversation_provider
904
+ == ConversationProvider .WINGMAN_PRO
900
905
and "gpt" in self .config .wingman_pro .conversation_deployment .lower ()
901
906
):
902
907
# generate tool calls in openai style
@@ -1312,7 +1317,7 @@ async def execute_command_by_function_call(
1312
1317
traceback .format_exc (), color = LogType .ERROR , server_only = True
1313
1318
)
1314
1319
function_response = (
1315
- "ERROR DURING PROCESSING" # hints to AI that there was an error
1320
+ "ERROR DURING PROCESSING" # hints to AI that there was an error
1316
1321
)
1317
1322
instant_response = None
1318
1323
finally :
0 commit comments