C1M1 assignment - 403 Client Error: Forbidden / Unauthorized

I’m currently working on the CrewAI course and encountered an issue with the graded assignment involving the SerperDevTool and ScrapeWebsiteTool.

My implementation follows the instructions provided in the notebook, and both tools are initialized correctly. However, when running the test cases, the Serper tool consistently fails with a 403 Unauthorized error.

Here are the key details:

  • The failure occurs when calling:
    serper_search_tool.run(query="SQL issues")

  • Error received: 403 Client Error: Forbidden / Unauthorized

  • This happens even when using the provided utils.get_serper_api_key() within the course environment.

  • The issue seems to be related to the Serper API key provided in the lab environment (possibly expired or rate-limited), rather than the implementation itself.

Because of this, the test case fails even though the code appears correct.

I would appreciate any guidance or clarification.

Thanks,
Ashish

Hi Ashish,
The issue is you deleted the base_url argument in SeperDevTool(). The original starter code should be serper_search_tool = None(search_url=None, base_url=os.getenv(“DLAI_SERPER_BASE_URL”)). Please add that argument, and it should work just fine.
Cheers,
Magdalena

1 Like