Skip to content

Commit 51d338e

Browse files
committed
update cli version for grok 3 streamed
1 parent acc1097 commit 51d338e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cli.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,8 @@ def chatgpt_streamed(user_input, system_message, mood_prompt, conversation_histo
650650
chunk = json.loads(line)
651651
delta_content = chunk['choices'][0]['delta'].get('content', '')
652652
if delta_content:
653+
# Clean the weird characters before printing
654+
delta_content = delta_content.replace(\x80\x99', "'")
653655
print(NEON_GREEN + delta_content + RESET_COLOR, end='', flush=True)
654656
full_response += delta_content
655657
except json.JSONDecodeError:
@@ -756,7 +758,7 @@ def record_audio(file_path, silence_threshold=512, silence_duration=4.0, chunk_s
756758
p = pyaudio.PyAudio()
757759
stream = p.open(format=pyaudio.paInt16, channels=1, rate=16000, input=True, frames_per_buffer=chunk_size)
758760
frames = []
759-
print("Recording...")
761+
print(f"{PINK}Recording...{RESET_COLOR}")
760762
silent_chunks = 0
761763
speaking_chunks = 0
762764
while True:

0 commit comments

Comments
 (0)