Skip to content

Commit

Permalink
In chat messages
Browse files Browse the repository at this point in the history
  • Loading branch information
KillianLucas committed Nov 9, 2024
1 parent 9f7a06e commit 8f2e22f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion interpreter_1/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,10 +621,19 @@ def chat(self):
try:
placeholder_color = "ansigray"

message_count = 0
while True:
# Determine placeholder text based on message count
if message_count in [0, 1]:
placeholder_text = 'Use """ for multi-line prompts'
elif message_count in []: # Disabled
placeholder_text = "Type /help for advanced commands"
else:
placeholder_text = ""

# Get first line of input with placeholder
placeholder = HTML(
f'<{placeholder_color}>Use """ for multi-line prompts</{placeholder_color}>'
f"<{placeholder_color}>{placeholder_text}</{placeholder_color}>"
)
user_input = prompt_session.prompt(
"> ", placeholder=placeholder
Expand All @@ -647,6 +656,8 @@ def chat(self):
user_input += line + "\n"
print()

message_count += 1 # Increment counter after each message

if user_input.startswith("/"):
parts = user_input.split(maxsplit=2)
cmd = parts[0].lower()
Expand Down

0 comments on commit 8f2e22f

Please sign in to comment.