Agentic AI Module 3 Graded Code Issue

  1. All three exercises fail with BadRequestError: you must provide a model parameter when submitted for grading, even though the functions work correctly when I run them manually in the notebook.

    The issue appears to be that CLIENT = OpenAI() relies on load_dotenv() having run first, but the grader runs functions in isolation without executing all cells from the top, so CLIENT is None.

    I cannot fix this inside the ### START CODE HERE ### blocks since CLIENT is referenced outside them in frozen cells.

    Also noting that tavily_search_tool returns a 500 Internal Server Error from the platform proxy, which may be a related infrastructure issue.

    How should the API key be configured so the grader can access it?

hi @Jelena_Spasojevic

can you confirm if you passed all 3 unittest for all 3 exercises before failing on submission. Also can you please post screenshot of your submission grader which provides separate information on all 3 exercises on why they failed the grader submission.

based on the information you have provided, within the code markers the client is ofcourse open.ai only but if you notice for each grade cells model is assigned with local argument which is recalled by “model”, so I hope you have not mixed the global/local variable recalls here.

For every exercise in detail, one would require to see the screenshot of your output for all 3 exercises, as you’re stating all cells ru. down successfully, my intuition is more pointing towards “you have used global variable instead of assigned arguments for each grade function cells” which you need to cross check again.

Also sometimes, if someone has submitted assignment without saving their work, can also lead to failed submission, so If you are confident your codes are correct, here is what you need to do, click on the clear kernel output, reconnect the kernel, re-run the cell from beginning till end, then click on save emicon first :floppy_disk:, now submit your assignment.

Let me know if issue still persist, then we might have to review your codes in personal DM conversation as posting codes on public post is considered against community guidelines.

regards
Dr. Deepti

All good – i did it in your environment. Sorry was trying to run parallely in a new notebook. Sorry all good now!