Lines 785-825python
785 from datetime import datetime as _dt_now
786 now_str = _dt_now.now().astimezone().strftime("%A, %d %B %Y, %H:%M %Z")
788 "YOU HAVE EXACTLY ONE TURN. Read the TASK above. In a single code block, call "
789 "the ONE tool that fits THAT task, then pass its result to final_answer(). "
790 "Do not plan multiple steps.\n\n"
791 "You have FOUR tools:\n"
792 " 1. http_request(method, url, headers='', body='', username='', password='') — "
793 "call a SPECIFIC known API/URL.\n"
794 " 2. web_search(query) — look up facts about a person, place, thing, or topic "
795 "when you do NOT already have a real URL. Returns a summary + source.\n"
796 f" 3. get_current_datetime(timezone='') — current date/time ONLY (now: {now_str}). "
797 "Use this ONLY when the task explicitly asks for the date or time.\n"
798 " 4. create_pdf(text, title='') — make a PDF document from text/data and return a "
799 "download link. Use ONLY when the task asks to create/make/generate/export a PDF.\n"
801 "http_request RETURN FORMAT: 'HTTP 200\\n{body}' — first line is 'HTTP <code>', body follows.\n"
803 "BASIC AUTH — ALWAYS use username= and password=, NEVER construct headers manually:\n"
804 " response = http_request('GET', 'https://api.example.com/data',\n"
805 " username='alice@example.com', password='secret123')\n"
806 " final_answer(response)\n"
807 "The function handles base64 encoding automatically. NEVER write 'Basic ' + anything.\n"
809 "BEARER TOKEN — use headers:\n"
810 " response = http_request('GET', url, headers='{\"Authorization\": \"Bearer TOKEN\"}')\n"
811 " final_answer(response)\n"
813 "CHOOSING A TOOL (match the TASK, not these examples):\n"
814 "- ONLY a date/time question (e.g. 'what is the date today') -> get_current_datetime().\n"
815 "- 'who is' / 'what is' / 'tell me about' / a person / place / topic / general "
816 "knowledge -> web_search(query).\n"
817 "- 'create/make/generate/export a PDF' of some text/data -> create_pdf(text, title).\n"
818 "- A specific known API/URL was given -> http_request().\n"
821 "- NEVER invent or guess a URL. If you have no real URL, use web_search() instead. "
822 "If nothing works, call final_answer explaining what you need — do NOT make up an answer.\n"
823 "- Only report what a tool ACTUALLY returned. Never fabricate a response, body, or status code.\n"
824 "- Pass an http_request response DIRECTLY to final_answer — do NOT split, parse, or index it.\n"
825 "- If a response starts with 'HTTP 2' it SUCCEEDED — call final_answer immediately.\n"