username
stringlengths
1
118
score
float64
0
100
timestamp
stringdate
2025-04-24 16:18:04
2025-08-21 15:28:20
code
stringlengths
10
42.3k
DORB7
0
2025-08-01T14:59:54.758580+00:00
https://huggingface.co/spaces/DORB7/Final_Assignment/tree/main
rosl1234
20
2025-08-01T15:41:02.697114+00:00
https://huggingface.co/spaces/rosl1234/Final_Assignment_Template/tree/main
rina0058
40
2025-08-01T15:44:28.818017+00:00
https://huggingface.co/spaces/rina0058/BotWish/tree/main
Akshay3517
0
2025-08-01T19:00:06.710624+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
Ramseths
100
2025-08-01T21:47:31.074070+00:00
https://huggingface.co/spaces/Ramseths/Final_Assignment_Template/tree/main
mikemayuare
5
2025-08-01T22:35:41.275334+00:00
https://huggingface.co/spaces/None/tree/main
TheGoodDevil
0
2025-08-02T06:29:01.212036+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
ananyashh
0
2025-08-02T10:15:49.278945+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
Elias-CIC
35
2025-08-02T11:13:00.320055+00:00
https://huggingface.co/spaces/None/tree/main
DNRaina
0
2025-08-02T12:49:48.821528+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
ChetanDK
0
2025-08-02T12:56:50.915749+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
edoschettino
90
2025-08-02T15:28:15.067924+00:00
https://huggingface.co/spaces/edoschettino/Final_Assignment_Template/tree/main
Juraboy
0
2025-08-02T17:13:43.755927+00:00
https://huggingface.co/spaces/Juraboy/Finall_Assignment_Agent/tree/main
kumasura
0
2025-08-03T01:00:21.094516+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
william7801
0
2025-08-03T02:38:02.710565+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
Vishal7042
0
2025-08-03T04:59:30.435001+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
diego-garcia-ortega
30
2025-08-03T06:39:10.493036+00:00
https://huggingface.co/spaces/None/tree/main
legolas140
0
2025-08-03T08:23:44.450129+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
sunilmanit
20
2025-08-03T08:42:54.593379+00:00
HF_Space_Link
avinashraghuvanshi
0
2025-08-03T08:56:39.150996+00:00
https://huggingface.co/spaces/avinashraghuvanshi/Final_Assignment_Avinash/tree/main
ihassan1
0
2025-08-03T09:03:05.593421+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
Sontia
0
2025-08-03T10:25:21.146552+00:00
https://huggingface.co/spaces/Sontia/Final_Assignment_Hugues/tree/main
apurva41
100
2025-08-03T13:02:32.052671+00:00
https://huggingface.co/spaces/apurva41/Final_Assignment_Template/tree/main
Sarthak1234321
0
2025-08-03T13:32:50.469386+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
racoondata
0
2025-08-03T13:45:03.073101+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
filipry
40
2025-08-03T13:59:25.605286+00:00
https://huggingface.co/spaces/None/tree/main
lnist
35
2025-08-03T15:04:08.792572+00:00
https://huggingface.co/spaces/None/tree/main
SonechkoNatali
30
2025-08-03T16:25:31.902537+00:00
https://huggingface.co/spaces/SonechkoNatali/Final_Assignment_Template/tree/main
ufehlg8
70
2025-08-03T17:59:51.209130+00:00
https://huggingface.co/spaces/ufehlg8/First_agent_template/tree/main
iamcam
40
2025-08-03T21:05:56.212810+00:00
https://huggingface.co/spaces/iamcam/Agents_Final_Assignment/tree/main
nicolacaione
10
2025-08-03T22:30:11.077644+00:00
https://huggingface.co/spaces/None/tree/main
HOhus
35
2025-08-03T22:32:26.670565+00:00
https://huggingface.co/spaces/None/tree/main
4rahman
30
2025-08-04T00:41:42.554865+00:00
https://huggingface.co/spaces/None/tree/main
YOUR_HF_USERNAME
5
2025-08-04T01:00:03.178963+00:00
https://www.kaggle.com/code/mohamedaliaamira/notebook2344dda7eb
NoelMetanoia
100
2025-08-04T03:20:59.030036+00:00
https://huggingface.co/spaces/NoelMetanoia/AI_Agents_Final_Assignment_test_duplikat/tree/main
shubha5555
10
2025-08-04T05:11:25.053344+00:00
https://huggingface.co/spaces/shubha5555/Final_Assignment_Template/tree/main
Spike20
100
2025-08-04T06:13:35.085322+00:00
https://huggingface.co/spaces/apurva41/Final_Assignment_Template/tree/main
saandip5
100
2025-08-04T06:24:38.686137+00:00
https://huggingface.co/spaces/saandip5/Final_Assignment_Template/tree/main
mok33
60
2025-08-04T07:40:39.868315+00:00
https://huggingface.co/spaces/None/tree/main
nimishj1992
0
2025-08-04T08:03:57.865627+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
zceraj
0
2025-08-04T08:26:20.660932+00:00
https://huggingface.co/spaces/zceraj/Final_Assignment_Template/tree/main
visvir
25
2025-08-04T09:08:45.591432+00:00
# Cell 1 (Improved): Installation with Explanations # Install the necessary libraries from PyPI. # - "huggingface_hub>=0.23.0": Required for logging into Hugging Face and interacting with models and spaces. # - "litellm>=1.37.0": A library that provides a unified interface for calling over 100 LLM APIs (e.g., OpenAI, Anthropic, Cohere). # - "smolagents[toolkit]>=0.0.19": The core agent framework. The `[toolkit]` extra installs default tools like WebSearchTool. !pip install "huggingface_hub>=0.23.0" "litellm>=1.37.0" "smolagents[toolkit]>=0.0.19" -q # Cell 2 (Improved): Securely Access API Keys and Login import os from google.colab import userdata from huggingface_hub import login # --- Hugging Face Hub Login --- # Access the secret key from Colab's secret manager for the Hugging Face Hub. # This token is necessary for using gated models or pushing results to a Space. hf_token = userdata.get('HUGGINGFACE_HUB_TOKEN') login(token=hf_token) # Cell 3 (Improved): Strategic Model Selection with Analysis from smolagents import LiteLLMModel, InferenceClientModel # --- STRATEGIC MODEL CHOICE --- MODEL_CHOICE = "QWEN_CODER_HF" if MODEL_CHOICE == "QWEN_CODER_HF": # Qwen models are strong at code generation, which aligns with CodeAgent's modality. # This uses the Hugging Face Inference API and the token from Cell 2. model = InferenceClientModel( model_id="Qwen/Qwen3-235B-A22B-Instruct-2507", provider="together", temperature=0.0, ) # Cell 4 (Improved): Creating a Robust Custom File Reader Tool from smolagents import Tool from typing import ClassVar class FileReaderTool(Tool): """A custom tool to read the entire contents of a file.""" name: ClassVar[str] = "file_reader" description: ClassVar[str] = ( "Reads the entire content of a file specified by its path and returns it as a single string. " "Use this tool whenever the user's question explicitly mentions a file name (e.g., 'Read data.txt')." "Example Usage: print(file_reader(file_path='data/some_document.txt'))" ) inputs: ClassVar[dict[str, dict]] = { "file_path": { "type": "string", "description": "The full or relative path to the file that needs to be read." } } output_type: ClassVar[str] = "string" def __init__(self): super().__init__() def forward(self, file_path: str) -> str: """ Reads and returns the content of the specified file. Includes robust error handling for common issues like FileNotFoundError. """ try: with open(file_path, 'r', encoding='utf-8') as f: content = f.read() return content except FileNotFoundError: return f"Error: The file was not found at the specified path: '{file_path}'. Please check the path and try again." except Exception as e: return f"An unexpected error occurred while trying to read the file '{file_path}': {str(e)}" # Cell 5 (Overhauled): Engineering a Hardened Prompt Strategy for Precision from smolagents import PlanningPromptTemplate, FinalAnswerPromptTemplate, ManagedAgentPromptTemplate SYSTEM_PROMPT = """ # MISSION You are a hyper-precise, autonomous AI agent. Your SOLE purpose is to answer the user's question with perfect accuracy and precision. You MUST operate according to the following rules and frameworks. Failure to do so will result in task failure. # CRITICAL RULES FOR FINAL ANSWER Your final output MUST be a call to the `final_answer` tool with a SINGLE argument. This argument MUST be one of the following raw data types: 1. A string (e.g., `final_answer("Mount Everest")`) 2. A number (e.g., `final_answer(8848)`) 3. A comma-separated list of strings/numbers (e.g., `final_answer("Everest, K2, Kangchenjunga")`) **YOU WILL FAIL IF YOUR FINAL ANSWER CONTAINS:** - Any explanatory or conversational text (e.g., `final_answer("The answer is Mount Everest")` is WRONG). - Any units like '$' or '%' unless the question explicitly requires it. - Any Python f-strings or variable references inside the `final_answer` call. The argument must be the raw value. # AVAILABLE TOOLS You have access to the following tools via Python code: 1. `web_search(query: str)`: Searches the internet. 2. `file_reader(file_path: str)`: Reads a local file. 3. **Python Interpreter**: For calculations, data manipulation, etc. You can import `pandas` and `numpy`. # REASONING FRAMEWORK (MANDATORY) You MUST follow this exact process: 1. **Deconstruct & Plan:** Analyze the user's question and create a step-by-step plan. Explain your plan clearly. 2. **Execute:** Execute your plan by writing and running Python code one step at a time. Use the available tools as needed. 3. **Analyze:** Scrutinize the output of each code execution. Check for errors or unexpected results. 4. **Final Answer:** Once you have found the answer, your final action MUST be a single line of code calling the `final_answer` tool. Do not print the answer first. Do not add any other text. Your entire output for the final step must be ONLY the code to call the tool. """ FINAL_ANSWER_PRE_MESSAGES = """ You have completed your self-critique and are 100% confident in the result. Your final and ONLY task is to call the `final_answer` tool with the raw data. **CRITICAL:** Do NOT write ANY other text, code, or explanation. Just the tool call. - Correct Example (string): `final_answer("Tommy L’ampart")` - Correct Example (number): `final_answer(2023)` - Correct Example (list): `final_answer("Pierre Agostini, Ferenc Krausz, Tommy L’ampart")` Now, provide the final answer. """ PLANNING_TEMPLATE = PlanningPromptTemplate( initial_plan="I will deconstruct the problem, create a step-by-step plan, execute it, perform a mandatory self-critique, and then provide the final answer in the required format.", update_plan_pre_messages="Review and update the plan if necessary.", update_plan_post_messages="The plan has been updated.", ) FINAL_ANSWER_TEMPLATE = FinalAnswerPromptTemplate( pre_messages=FINAL_ANSWER_PRE_MESSAGES, post_messages="The final answer has been provided.", ) MANAGED_AGENT_TEMPLATE = ManagedAgentPromptTemplate( task="You are a helpful assistant.", report="Reporting back on the completed task.", ) import re def is_not_empty(final_answer: str, agent_memory=None) -> bool: if not final_answer or str(final_answer).strip() == "": print("Final answer check failed: Answer is empty.") return False return True def is_correctly_formatted(final_answer: str, agent_memory=None) -> bool: answer_str = str(final_answer) checks = { "Contains conversational filler words (e.g., 'The answer is...')": r"^(the answer is|final answer:|here is the result|i found that)\\s+", "Contains leading articles ('a', 'an', 'the')": r"^\\b(a|an|the)\\s+", "Contains currency symbols (e.g., '$', '£')": r"[\\$£€¥]", "Contains commas used as thousands separators in numbers (e.g., '8,848')": r"\\d,\\d", "Contains trailing punctuation (e.g., 'John.')": r"[.!?]$", "Contains units after a number (e.g., '12 albums')": r"^\\d+(\\.\\d+)?\\s+[a-zA-Z]+s?$", } for reason, pattern in checks.items(): if re.search(pattern, answer_str, re.IGNORECASE): print(f"Final answer check failed: {reason}. Invalid answer: '{answer_str}'") return False return True validation_checks = [is_not_empty, is_correctly_formatted] # Cell 6 (Corrected): Assembling the Agent with Programmatic Guardrails from smolagents import CodeAgent, WebSearchTool, PromptTemplates web_search_tool = WebSearchTool() file_reader_tool = FileReaderTool() tools = [web_search_tool, file_reader_tool] prompt_templates = PromptTemplates( system_prompt=SYSTEM_PROMPT, planning=PLANNING_TEMPLATE, final_answer=FINAL_ANSWER_TEMPLATE, managed_agent=MANAGED_AGENT_TEMPLATE, ) gaia_agent = CodeAgent( model=model, tools=tools, instructions=SYSTEM_PROMPT, prompt_templates=prompt_templates, additional_authorized_imports=["pandas", "numpy"], stream_outputs=True, max_steps=15, verbosity_level=1, final_answer_checks=validation_checks, ) # %% [code] # Cell 9: Running Local Evaluation (Using gaia_agent) import requests import json from tqdm import tqdm import textwrap API_URL = "https://agents-course-unit4-scoring.hf.space" print("Fetching evaluation questions from the course scoring server...") try: questions_response = requests.get(f"{API_URL}/questions") questions_response.raise_for_status() questions = questions_response.json() print(f" ✅ Successfully loaded {len(questions)} evaluation tasks.") except requests.exceptions.RequestException as e: print(f" ❌ Error fetching questions: {e}") questions = [] answers = [] if questions: print("\n--- Starting Local Evaluation Run (Silent Mode) ---") for q in tqdm(questions, desc="Solving GAIA Tasks"): task_id = q.get("task_id") task = q.get("question") final_answer_text = f"ERROR: Agent failed to produce a final answer for task {task_id}." try: final_output = gaia_agent.run(task=task, max_steps=15, stream=False) if isinstance(final_output, str): final_answer_text = final_output elif isinstance(final_output, dict) and final_output.get("type") == "final_answer": final_answer_text = final_output.get("text", "ERROR: Malformed final answer.") elif isinstance(final_output, dict): final_answer_text = f"ERROR: Agent stopped (max_steps likely reached)." except Exception as e: final_answer_text = f"ERROR: {e}" answers.append({"task_id": task_id, "submitted_answer": str(final_answer_text).strip()}) print(" ✅ Agent has attempted all tasks.") if answers: print("\nSubmitting answers for scoring...") try: scoring_response = requests.post( f"{API_URL}/", json={"questions": questions, "answers": answers} ) scoring_response.raise_for_status() score_data = scoring_response.json() print("\n--- 🏆 LOCAL EVALUATION COMPLETE 🏆 ---") print(f"Final Score: {score_data.get('score', 0) * 100:.2f}%") print("------------------------------------") except requests.exceptions.RequestException as e: print(f"\n ❌ Automated submission failed: {e}") print("This may be a temporary server issue.") print("\n--- MANUAL SUBMISSION (PLAN B) ---") print("You can copy the JSON below and submit it manually.") answers_json = json.dumps(answers, indent=2) wrapped_json = textwrap.fill(answers_json, width=80) print("\nCOPY THE FOLLOWING JSON:\n") print("="*40) print(wrapped_json) print("="*40)
skhedekar
0
2025-08-04T09:23:13.283568+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
MohamedAmineMehrez
100
2025-08-04T10:45:22.120962+00:00
https://huggingface.co/spaces/clokoihue/hf_agents_course_gaia_agent/tree/main
winstonpang
45
2025-08-04T12:14:34.504136+00:00
https://huggingface.co/spaces/winstonpang/HF_Agent_Assignment/tree/main
kxr3n
0
2025-08-04T13:34:30.837845+00:00
https://huggingface.co/spaces/kxr3n/Final_Assignment_Template/tree/main
WTvhUrUe
5
2025-08-04T15:09:16.974279+00:00
https://huggingface.co/spaces/WTvhUrUe/Final_Assignment_Template/tree/main
newbienoob
0
2025-08-04T15:19:08.440578+00:00
https://huggingface.co/spaces/newbienoob/gokul-gaia-agent/tree/main
doubleman89
10
2025-08-04T16:35:48.143684+00:00
https://huggingface.co/spaces/doubleman89/Final_Assignment_Template/tree/main
smalirizvi
30
2025-08-04T16:45:03.308431+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
khush1404
40
2025-08-04T17:05:00.287450+00:00
stringstri
Danmellof
40
2025-08-05T01:19:54.041379+00:00
https://huggingface.co/spaces/Danmellof/test/tree/main
ragunath-ravi
0
2025-08-05T02:17:59.815785+00:00
https://huggingface.co/spaces/ragunath-ravi/Final_Assignment/tree/main
zhihao64
0
2025-08-05T05:06:19.742365+00:00
https://huggingface.co/spaces/zhihao64/Final_Assignment_Agent_Course/tree/main
raphaelpts
35
2025-08-05T05:07:56.395464+00:00
https://huggingface.co/spaces/raphaelpts/AI_Agent_Duff/tree/main
ljj1291599896
0
2025-08-05T07:43:05.484438+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
a-min7
5
2025-08-05T09:13:37.386692+00:00
https://huggingface.co/spaces/None/tree/main
patelharshal126
0
2025-08-05T09:48:09.853461+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
bdolega0
0
2025-08-05T11:20:43.297287+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
nikk92
5
2025-08-05T11:25:56.161625+00:00
https://huggingface.co/spaces/nikk92/agents-course-nikk92
JerajJain
0
2025-08-05T12:25:41.176300+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
CasperCvO
60
2025-08-05T12:32:12.573391+00:00
https://huggingface.co/spaces/None/tree/main
adelchi91
25
2025-08-05T13:32:52.407436+00:00
https://huggingface.co/spaces/adelchi91/ai-agents-assignment/tree/main
Sewatar
0
2025-08-05T14:35:20.013272+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
TheresiaElKhoury
0
2025-08-05T14:45:27.743845+00:00
https://huggingface.co/spaces/TheresiaElKhoury/Final_Assignment_Template/tree/main
anish129
0
2025-08-05T16:37:15.772705+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
y0nier
100
2025-08-05T16:59:54.648149+00:00
https://huggingface.co/spaces/y0nier/agents-course-Final_Assignment_Template/tree/main
hadil12
35
2025-08-05T17:14:04.160701+00:00
https://www.kaggle.com/code/hadil01/notebook95e4f95140
Incharamp
0
2025-08-05T19:01:40.932057+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
MohamedAliAmiraa
40
2025-08-05T19:33:00.035924+00:00
https://www.kaggle.com/code/mohamedaliaamira/hf-agent
Abdellatif-belmady
20
2025-08-05T20:42:34.319359+00:00
https://huggingface.co/spaces/Abdellatif-belmady/Final_Assignment_Template/tree/main
ankitamod
100
2025-08-05T21:46:35.238522+00:00
https://huggingface.co/spaces/ankitamod/Final_Assignment_Templateamm/tree/main
Gaemmx
35
2025-08-05T21:56:02.760381+00:00
https://huggingface.co/spaces/Gaemmx/Finalcountdown/tree/main
xilom
15
2025-08-06T00:35:20.526323+00:00
https://huggingface.co/spaces/None/tree/main
vitalune
35
2025-08-06T01:35:08.416314+00:00
https://huggingface.co/spaces/vitalune/Final_Assignment_Template/tree/main
gamefreakoneone
10
2025-08-06T02:03:53.877142+00:00
https://huggingface.co/spaces/gamefreakoneone/Final_Agent_Assignment/tree/main
Dozerex
0
2025-08-06T04:16:35.498558+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
HenryRnode
65
2025-08-06T04:49:19.632541+00:00
https://huggingface.co/spaces/HenryRnode/Final_Assignment_Template/tree/main
pcumani
50
2025-08-06T06:31:26.992302+00:00
https://huggingface.co/spaces/None/tree/main
carolasegale
45
2025-08-06T07:35:04.562031+00:00
https://huggingface.co/spaces/carolasegale/gaia_agent/tree/main
lionevan
0
2025-08-06T10:14:06.859498+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
Poojamankar77
0
2025-08-06T10:15:54.399617+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
Maxmax1992
15
2025-08-06T10:27:41.213915+00:00
https://huggingface.co/spaces/Maxmax1992/FinalAgentsSubmissionProject/tree/main
akhilaasok99
0
2025-08-06T12:09:20.107330+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
leedoj
35
2025-08-06T13:23:00.210340+00:00
https://huggingface.co/spaces/leedoj/Final_Assignment_Template_v4/tree/main
jjgianlo
0
2025-08-06T13:28:00.181813+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
Irshad-27
35
2025-08-06T13:31:29.467525+00:00
https://huggingface.co/spaces/Irshad-27/Final_Assignment_Template/tree/main
maricaantonacci
0
2025-08-06T14:11:02.819504+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
AkaishaS
0
2025-08-06T16:30:54.984425+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
deltahedge1
30
2025-08-06T16:59:48.494677+00:00
https://huggingface.co/spaces/None/tree/main
Hamghalam
0
2025-08-06T18:22:21.028834+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
nick-pavic
0
2025-08-06T19:06:17.078879+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
wilhelmu
35
2025-08-06T19:15:10.616454+00:00
https://huggingface.co/spaces/wilhelmu/unit_4/tree/main
walt-22r
0
2025-08-06T19:52:09.719842+00:00
https://huggingface.co/spaces/walt-22r/Final_Assignment_Template/tree/main
vuong
0
2025-08-06T19:53:08.274042+00:00
get_weather
robdreamville
50
2025-08-06T20:24:14.762527+00:00
https://huggingface.co/spaces/robdreamville/Final_Assignment_Template/tree/main
Leix34
10
2025-08-06T22:08:12.415791+00:00
https://huggingface.co/spaces/None/tree/main
vuongnguyen2604
35
2025-08-07T04:47:43.577477+00:00
https://huggingface.co/spaces/vuongnguyen2604/agent-01/tree/main
Preetim240027
0
2025-08-07T06:48:02.239434+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main
Junlang
0
2025-08-07T08:21:30.627698+00:00
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/tree/main