Skip to content

Commit 026623d

Browse files
committed
Incoming
1 parent 459208e commit 026623d

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

computer_use/loop.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@
6161
if "--model" in sys.argv and sys.argv[sys.argv.index("--model") + 1]:
6262
model_choice = sys.argv[sys.argv.index("--model") + 1]
6363

64-
print(model_choice)
65-
6664
md = MarkdownStreamer()
6765

6866
COMPUTER_USE_BETA_FLAG = "computer-use-2024-10-22"
@@ -243,8 +241,8 @@ async def sampling_loop(
243241
current_block = None
244242

245243
for chunk in raw_response:
246-
chunk = chunk.choices[0]
247-
# time.sleep(5)
244+
# chunk = chunk.choices[0]
245+
# # time.sleep(5)
248246
if isinstance(chunk, BetaRawContentBlockStartEvent):
249247
current_block = chunk.content_block
250248
elif isinstance(chunk, BetaRawContentBlockDeltaEvent):
@@ -344,10 +342,12 @@ async def sampling_loop(
344342
print(f"\n\033[38;5;240mRun actions above\033[0m?")
345343
user_approval = input("\n(y/n): ").lower().strip()
346344
elif len(tool_use_blocks) == 1:
347-
print(
348-
f"\n\033[38;5;240mRun tool \033[0m\033[1m{tool_use_blocks[0].name}\033[0m?"
349-
)
345+
print(f"\n\033[38;5;240mRun tool?\033[0m")
346+
# print(
347+
# f"\n\033[38;5;240mRun tool \033[0m\033[1m{tool_use_blocks[0].name}\033[0m?"
348+
# )
350349
user_approval = input("\n(y/n): ").lower().strip()
350+
print()
351351

352352
tool_result_content: list[BetaToolResultBlockParam] = []
353353
for content_block in cast(list[BetaContentBlock], response.content):
@@ -618,15 +618,6 @@ def original_welcome():
618618
print_markdown("---")
619619
time.sleep(0.5)
620620

621-
# Check for API key in environment variable
622-
api_key = os.environ.get("ANTHROPIC_API_KEY")
623-
if not api_key:
624-
api_key = input(
625-
"\nAn Anthropic API is required for OS mode.\n\nEnter your Anthropic API key: "
626-
)
627-
print_markdown("\n---")
628-
time.sleep(0.5)
629-
630621
import random
631622

632623
tips = [
@@ -655,6 +646,15 @@ def new_welcome():
655646
print_markdown("---")
656647
time.sleep(0.5)
657648

649+
# Check for API key in environment variable
650+
api_key = os.environ.get("ANTHROPIC_API_KEY")
651+
if not api_key:
652+
api_key = input(
653+
"\nAn Anthropic API is required for OS mode.\n\nEnter your Anthropic API key: "
654+
)
655+
print_markdown("\n---")
656+
time.sleep(0.5)
657+
658658
# new_welcome()
659659

660660
# Start the mouse position checking thread

computer_use/ui/edit.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ def _render_line(self, line):
146146
# line_prefix = f"{SchemaRenderer.GRAY_COLOR} │ {SchemaRenderer.RESET_COLOR}"
147147
highlighted = highlight(chunks[0] + "\n", lexer, formatter).rstrip()
148148
sys.stdout.write(f"{line_prefix}{highlighted}\n")
149+
# sys.stdout.write(f"{line_prefix}" + " ".join(highlighted) + "\n") # For debugging
149150

150151
# Print remaining chunks with padding and pipe
151152
continuation_prefix = (
@@ -450,7 +451,7 @@ class OldStrRenderer(ContentRenderer):
450451
def __init__(self, style):
451452
super().__init__(style)
452453
SchemaRenderer.print_separator("┼")
453-
self.RED_COLOR = "\033[38;5;197m" # Monokai red color (more purple)
454+
self.RED_COLOR = "\033[39m\033[38;5;204m" # Monokai red
454455
self.RESET_COLOR = "\033[0m"
455456
self.rendered_content = ""
456457
self.line_number = 1

0 commit comments

Comments
 (0)