|
61 | 61 | if "--model" in sys.argv and sys.argv[sys.argv.index("--model") + 1]: |
62 | 62 | model_choice = sys.argv[sys.argv.index("--model") + 1] |
63 | 63 |
|
64 | | -print(model_choice) |
65 | | - |
66 | 64 | md = MarkdownStreamer() |
67 | 65 |
|
68 | 66 | COMPUTER_USE_BETA_FLAG = "computer-use-2024-10-22" |
@@ -243,8 +241,8 @@ async def sampling_loop( |
243 | 241 | current_block = None |
244 | 242 |
|
245 | 243 | for chunk in raw_response: |
246 | | - chunk = chunk.choices[0] |
247 | | - # time.sleep(5) |
| 244 | + # chunk = chunk.choices[0] |
| 245 | + # # time.sleep(5) |
248 | 246 | if isinstance(chunk, BetaRawContentBlockStartEvent): |
249 | 247 | current_block = chunk.content_block |
250 | 248 | elif isinstance(chunk, BetaRawContentBlockDeltaEvent): |
@@ -344,10 +342,12 @@ async def sampling_loop( |
344 | 342 | print(f"\n\033[38;5;240mRun actions above\033[0m?") |
345 | 343 | user_approval = input("\n(y/n): ").lower().strip() |
346 | 344 | 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 | + # ) |
350 | 349 | user_approval = input("\n(y/n): ").lower().strip() |
| 350 | + print() |
351 | 351 |
|
352 | 352 | tool_result_content: list[BetaToolResultBlockParam] = [] |
353 | 353 | for content_block in cast(list[BetaContentBlock], response.content): |
@@ -618,15 +618,6 @@ def original_welcome(): |
618 | 618 | print_markdown("---") |
619 | 619 | time.sleep(0.5) |
620 | 620 |
|
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 | | - |
630 | 621 | import random |
631 | 622 |
|
632 | 623 | tips = [ |
@@ -655,6 +646,15 @@ def new_welcome(): |
655 | 646 | print_markdown("---") |
656 | 647 | time.sleep(0.5) |
657 | 648 |
|
| 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 | + |
658 | 658 | # new_welcome() |
659 | 659 |
|
660 | 660 | # Start the mouse position checking thread |
|
0 commit comments