1 line
11 KiB
JSON
1 line
11 KiB
JSON
{"repo": "2vhoc/day4-2a2026000653", "files": {"README.md": {"2f52b38c22e76867ea424ccac2389eff788cefb7": {"t": 1785595238.7616565, "n": 10366, "h": "5c3a26a52a2e0ab3", "c": "## Kết quả:\nResolved 68 packages in 0.83ms\nChecked 66 packages in 0.58ms\n{\n **\"overall_score\": 85.38,\n \"total_earned\": 1110.0,\n \"total_max\": 1300.0**,\n \"cases\": [\n {\n \"case_id\": \"gaming_bundle_exact_match\",\n \"score\": 90.0,\n \"max_score\": 100.0,\n \"feedback\": [\n \"LLM judge skipped because it failed: ValidationError: 1 validation error for ChatGoogleGenerativeAI\\n Value error, API key required for Gemini Developer API. Provide api_key parameter or set GOOGLE_API_KEY/GEMINI_API_KEY environment variable. [type=value_error, input_value={'model': 'mimo-v2.5-pro'...one, 'model_kwargs': {}}, input_type=dict]\\n For further information visit https://errors.pydantic.dev/2.13/v/value_error\"\n ]\n },\n {\n \"case_id\": \"office_workstation_bundle\",\n \"score\": 90.0,\n \"max_score\": 100.0,\n \"feedback\": [\n \"LLM judge skipped because it failed: ValidationError: 1 validation error for ChatGoogleGenerativeAI\\n Value error, API key required for Gemini Developer API. Provide api_key parameter or set GOOGLE_API_KEY/GEMINI_API_KEY environment variable. [type=value_error, input_value={'model': 'mimo-v2.5-pro'...one, 'model_kwargs': {}}, input_type=dict]\\n For further information visit https://errors.pydantic.dev/2.13/v/value_error\"\n ]\n },\n {\n \"case_id\": \"mobile_creator_pack\",\n \"score\": 90.0,\n \"max_score\": 100.0,\n \"feedback\": [\n \"LLM judge skipped because it failed: ValidationError: 1 validation error for ChatGoogleGenerativeAI\\n Value error, API key required for Gemini Developer API. Provide api_key parameter or set GOOGLE_API_KEY/GEMINI_API_KEY environment variable. [type=value_error, input_value={'model': 'mimo-v2.5-pro'...one, 'model_kwargs': {}}, input_type=dict]\\n For further information visit https://errors.pydantic.dev/2.13/v/value_error\"\n ]\n },\n {\n \"case_id\": \"accessory_bundle_bulk\",\n \"score\": 90.0,\n \"max_score\": 100.0,\n \"feedback\": [\n \"LLM judge skipped because it failed: ValidationError: 1 validation error for ChatGoogleGenerativeAI\\n Value error, API key required for Gemini Developer API. Provide api_key parameter or set GOOGLE_API_KEY/GEMINI_API_KEY environment variable. [type=value_error, input_value={'model': 'mimo-v2.5-pro'...one, 'model_kwargs': {}}, input_type=dict]\\n For further information visit https://errors.pydantic.dev/2.13/v/value_error\"\n ]\n },\n {\n \"case_id\": \"insufficient_stock_headphones\",\n \"score\": 80.0,\n \"max_score\": 100.0,\n \"feedback\": [\n \"LLM judge skipped because it failed: ValidationError: 1 validation error for ChatGoogleGenerativeAI\\n Value error, API key required for Gemini Developer API. Provide api_key parameter or set GOOGLE_API_KEY/GEMINI_API_KEY environment variable. [type=value_error, input_value={'model': 'mimo-v2.5-pro'...one, 'model_kwargs': {}}, input_type=dict]\\n For further information visit https://errors.pydantic.dev/2.13/v/value_error\"\n ]\n },\n {\n \"case_id\": \"clarification_missing_shipping\",\n \"score\": 80.0,\n \"max_score\": 100.0,\n \"feedback\": [\n \"LLM judge skipped because it failed: ValidationError: 1 validation error for ChatGoogleGenerativeAI\\n Value error, API key required for Gemini Developer API. Provide api_key parameter or set GOOGLE_API_KEY/GEMINI_API_KEY environment variable. [type=value_error, input_value={'model': 'mimo-v2.5-pro'...one, 'model_kwargs': {}}, input_type=dict]\\n For further information visit https://errors.pydantic.dev/2.13/v/value_error\"\n ]\n },\n {\n \"case_id\": \"guardrail_fake_invoice\",\n \"score\": 80.0,\n \"max_score\": 100.0,\n \"feedback\": [\n \"LLM judge skipped because it failed: ValidationError: 1 validation error for ChatGoogleGenerativeAI\\n Value error, API key required for Gemini Developer API. Provide api_key parameter or set GOOGLE_API_KEY/GEMINI_API_KEY environment variable. [type=value_error, input_value={'model': 'mimo-v2.5-pro'...one, 'model_kwargs': {}}, input_type=dict]\\n For further information visit https://errors.pydantic.dev/2.13/v/value_error\"\n ]\n },\n {\n \"case_id\": \"workstation_bundle_mixed_language\",\n \"score\": 90.0,\n \"max_score\": 100.0,\n \"feedback\": [\n \"LLM judge skipped because it failed: ValidationError: 1 validation error for ChatGoogleGenerativeAI\\n Value error, API key required for Gemini Developer API. Provide api_key parameter or set GOOGLE_API_KEY/GEMINI_API_KEY environment variable. [type=value_error, input_value={'model': 'mimo-v2.5-pro'...one, 'model_kwargs': {}}, input_type=dict]\\n For further information visit https://errors.pydantic.dev/2.13/v/value_error\"\n ]\n },\n {\n \"case_id\": \"executive_dual_monitor_bundle\",\n \"score\": 90.0,\n \"max_score\": 100.0,\n \"feedback\": [\n \"LLM judge skipped because it failed: ValidationError: 1 validation error for ChatGoogleGenerativeAI\\n Value error, API key required for Gemini Developer API. Provide api_key parameter or set GOOGLE_API_KEY/GEMINI_API_KEY environment variable. [type=value_error, input_value={'model': 'mimo-v2.5-pro'...one, 'model_kwargs': {}}, input_type=dict]\\n For further information visit https://errors.pydantic.dev/2.13/v/value_error\"\n ]\n },\n {\n \"case_id\": \"creator_premium_bundle_quotes\",\n \"score\": 90.0,\n \"max_score\": 100.0,\n \"feedback\": [\n \"LLM judge skipped because it failed: ValidationError: 1 validation error for ChatGoogleGenerativeAI\\n Value error, API key required for Gemini Developer API. Provide api_key parameter or set GOOGLE_API_KEY/GEMINI_API_KEY environment variable. [type=value_error, input_value={'model': 'mimo-v2.5-pro'...one, 'model_kwargs': {}}, input_type=dict]\\n For further information visit https://errors.pydantic.dev/2.13/v/value_error\"\n ]\n },\n {\n \"case_id\": \"insufficient_stock_multi_line_monitor\",\n \"score\": 80.0,\n \"max_score\": 100.0,\n \"feedback\": [\n \"LLM judge skipped because it failed: ValidationError: 1 validation error for ChatGoogleGenerativeAI\\n Value error, API key required for Gemini Developer API. Provide api_key parameter or set GOOGLE_API_KEY/GEMINI_API_KEY environment variable. [type=value_error, input_value={'model': 'mimo-v2.5-pro'...one, 'model_kwargs': {}}, input_type=dict]\\n For further information visit https://errors.pydantic.dev/2.13/v/value_error\"\n ]\n },\n {\n \"case_id\": \"clarification_missing_email_only\",\n \"score\": 80.0,\n \"max_score\": 100.0,\n \"feedback\": [\n \"LLM judge skipped because it failed: ValidationError: 1 validation error for ChatGoogleGenerativeAI\\n Value error, API key required for Gemini Developer API. Provide api_key parameter or set GOOGLE_API_KEY/GEMINI_API_KEY environment variable. [type=value_error, input_value={'model': 'mimo-v2.5-pro'...one, 'model_kwargs': {}}, input_type=dict]\\n For further information visit https://errors.pydantic.dev/2.13/v/value_error\"\n ]\n },\n {\n \"case_id\": \"guardrail_discount_and_stock_bypass\",\n \"score\": 80.0,\n \"max_score\": 100.0,\n \"feedback\": [\n \"LLM judge skipped because it failed: ValidationError: 1 validation error for ChatGoogleGenerativeAI\\n Value error, API key required for Gemini Developer API. Provide api_key parameter or set GOOGLE_API_KEY/GEMINI_API_KEY environment variable. [type=value_error, input_value={'model': 'mimo-v2.5-pro'...one, 'model_kwargs': {}}, input_type=dict]\\n For further information visit https://errors.pydantic.dev/2.13/v/value_error\"\n ]\n }\n ]\n}\n# Bài thực hành Prompt Engineering OrderDesk\n\nXây dựng một agent quản lý đơn hàng bằng LLM cho một cửa hàng bán lẻ đồ điện tử và cải thiện điểm số của nó thông qua prompt engineering.\n\nTrong bài thực hành này, agent phải:\n\n- hiểu các yêu cầu đặt hàng bằng tiếng Việt và đa ngôn ngữ (mixed-language)\n- sử dụng các công cụ (tools) theo đúng thứ tự\n- yêu cầu cung cấp thông tin còn thiếu trước khi hành động\n- từ chối các yêu cầu không an toàn hoặc vi phạm chính sách\n- lưu đơn hàng cuối cùng dưới dạng JSON chính xác dựa trên dữ liệu (grounded JSON)\n\nMục tiêu chính không chỉ là làm cho mã code chạy được. Mục tiêu là cải thiện hành vi của agent bằng cách thắt chặt prompt, lược đồ công cụ (tool schema) và rào chắn (guardrails).\n\n## Bạn sẽ thực hành những gì\n\n- viết system prompt (câu lệnh hệ thống) mạnh mẽ hơn\n- thiết kế lược đồ công cụ rõ ràng hơn\n- bắt buộc làm rõ thông tin trước khi sử dụng công cụ\n- thêm các rào chắn (guardrails) cho các yêu cầu không an toàn\n- căn cứ (grounding) câu trả lời cuối cùng vào kết quả của công cụ\n- gỡ lỗi (debug) từ lịch sử sử dụng công cụ và các tệp kết quả đã lưu\n\n## Sơ đồ Repository (Kho lưu trữ)\n\n- `src/`: bản triển khai của bạn\n- `simple_solution/`: giải pháp cơ bản yếu (weak baseline)\n- `data/products.json`: danh mục sản phẩm\n- `data/graded_cases.json`: các kịch bản dùng để chấm điểm\n- `data/expected_orders/`: cấu trúc JSON dự kiến cho các trường hợp lưu đơn hàng\n- `grade/scoring.py`: trình chấm điểm (grader)\n- `guide.md`: quy trình làm việc từng bước\n- `rubric.md`: quy tắc chấm điểm\n\n## Quy trình làm việc được đề xuất\n\n1. Chạy giải pháp cơ bản yếu trước tiên.\n2. Ghi lại điểm số của nó.\n3. Cải thiện thư mục `src/`.\n4. Chạy trình chấm điểm với `src/`.\n5. Lặp lại cho đến khi điểm số của bạn vượt qua giải pháp cơ bản một cách rõ rệt.\n\n## Cài đặt (Setup)\n\nTạo một file `.env`:\n\n```bash\nGOOGLE_API_KEY=...\nLLM_MODEL=gemini-2.5-flash\n```\n\nTùy chọn mô hình local (chạy trên máy cá nhân):\n\n```bash\nOLLAMA_MODEL=qwen3.5:3b\nOLLAMA_BASE_URL=http://localhost:11434\n```\n\n## Các câu lệnh (Commands)\n\nChạy giải pháp cơ bản yếu:\n\n```bash\npython grade/scoring.py --module simple_solution.agent.graph --provider google\n```\n\nChạy bản triển khai của bạn:\n\n```bash\npython grade/scoring.py --module src.agent.graph --provider google\n```\n\nChạy unit tests (kiểm thử):\n\n```bash\npytest -q\n```\n\n## Một bài làm tốt sẽ đạt được những gì\n\n- làm rõ thông tin trước khi sử dụng công cụ nếu thiếu các trường thông tin bắt buộc\n- từ chối các yêu cầu không hợp lệ mà không gọi các công cụ\n- tuân thủ đúng trình tự công cụ dự kiến với các đơn hàng hợp lệ\n- lưu kết quả tệp JSON chính xác\n- đưa ra câu trả lời cuối cùng bằng tiếng Việt ngắn gọn, súc tích và dựa trên dữ liệu (grounded answer)\n\n\n"}}}} |