Files
context-paging/output/turn_034.json

2 lines
2.7 KiB
JSON
Raw Normal View History

2026-03-28 08:54:57 +00:00
{"id":"chatcmpl-8a2821ea4e71e1a5","object":"chat.completion","created":1774197550,"model":"NousResearch\/Hermes-3-Llama-3.2-3B","choices":[{"index":0,"message":{"role":"assistant","content":"In our original color-coded CLI output, we used the following ANSI escape sequences and color function calls:\n\n- Red for high priority:\n ```python\n color = Fore.RED\n ```\n\n- Yellow for medium priority:\n ```python\n color = Fore.YELLOW\n ```\n\n- Green for low priority:\n ```python\n color = Fore.GREEN\n ```\n\n- Progress bar format string:\n ```python\n color = Fore.YELLOW if task.progress is None else Fore.GREEN if task.progress < 50 else Fore.RED\n print(f\"{color}ID: {task.id}, Title: {task.title}, Description: {task.description}, Completed: {task.completed}, Priority: {task.priority}, Tags: {', '.join(task.tags)}, Depends On: {', '.join([self.tasks_by_id[dep_id][0]['title'] for dep_id in task.depends_on])}, Time Spent: {task.time_spent}, Assigned To: {task.assigned_to}, Estimated Minutes: {task.estimated_minutes}{Style.RESET_ALL}\")\n ```\n\nTo replicate this in the rich-based CLI dashboard, you can use the following code:\n\n```python\nfrom rich.style import Style\n\ndef get_priority_color(priority):\n if priority == 'high':\n return Style(color='red')\n elif priority == 'medium':\n return Style(color='yellow')\n elif priority == 'low':\n return Style(color='green')\n else:\n return Style(color='white')\n\ndef get_progress_color(progress):\n color = Fore.YELLOW if progress is None else Fore.GREEN if progress < 50 else Fore.RED\n return Style(color=color)\n\n# Rest of the code...\n```\n\nIn the code above:\n\n1. We define a get_priority_color function that takes the priority level as input and returns the corresponding ANSI color style.\n2. We define a get_progress_color function that takes the progress percentage as input and returns the corresponding ANSI color style based on the progress percentage.\n3. We use the get_priority_color function to set the color of the priority field in the rich-based CLI dashboard.\n4. We use the get_progress_color function to set the color of the progress field in the rich-based CLI dashboard.\n\nBy using the get_priority_color and get_progress_color functions, we can replicate the exact same colors and progress bar format as in the original CLI output.","refusal":null,"annotations":null,"audio":null,"function_call":null,"tool_calls":[],"reasoning":null},"logprobs":null,"finish_reason":"stop","token_ids":null}],"service_tier":null,"system_fingerprint":null,"usage":{"prompt_tokens":27744,"total_tokens":28226,"completion_tokens":482,"prompt_tokens_details":null},"prompt_token_ids":null,"kv_transfer_params":null}