Agentic AI Module 5- Graded assignement - Getting error-Failed test case:

Hi all- I am getting below error i have checked all the code.Looks all good, but here is the error -Failed test case: planner_agent raised TypeError: argument of type ‘NoneType’ is not iterable. Expected: no exception, but got: argument of type ‘NoneType’ is not iterable. GRADED FUNCTION: planner_agent

def planner_agent(topic: str, model: str = “openai:o4-mini”) → list[str]:
codes removed as posting grade function code is considered direct violation of code of conduct. instead of posting codes share screenshot of your failed unit test or failed submission grader output. if a mentor wants to look at your codes, they will ask you to send them by personal DM

@Snehalata_Kumari,

A NoneType error can often suggest that you overlooked filling in one of the None values in the section you are supposed to edit. Is it possible you overlooked a place you were supposed to fill in in the planner_agent function? Or maybe you forgot to save your edits before submitting to the grader? Or edited a different version of the assignment than you submitted?

I can reproduce exactly the error you are seeing if I do not replace the Nonein model=None in this section of the planner_agent code (showing the un-edited version with None’s):


    ### START CODE HERE ###

    # Call the LLM
    response = CLIENT.chat.completions.create( 
        # Pass in the model
        model=None,
        # Define the messages. Remember this is meant to be a user prompt!
        messages=None,
        # Keep responses creative
        temperature=1, 
    )
    ### END CODE HERE ###


Thanks @Wendy. Yes I also thought so.. checked multiple times.

Finally tired, I restarted the assignment and redo the same changes and it worked.

@Snehalata_Kumari,

Hmm, mysterious, but glad restarting worked for you!

Hi Snehalata_Kumari,

You can also get a NoneType error if your call to a language model fails and a variable gets assigned None. In any case, it’s good to see that you managed to pass the assignment!

  1. Similar issue with the final grade on exercises in Chapter 5 were competed and output is good. but the grader panel look like i there were errors of non completion of code as if it graded before my submissions exercise 3 and 5 . even thought out put looks nominal. I have markdown of final out put on execise 5 but only graded at 20/40 but all uni test nominals. I must say very frustrating for all hours worked I would like certification! Editor Agent

    All tests passed!Exercise 3

    0/10 points

    Failed test case: writer_agent raised LLMError: An error occurred: ‘NoneType’ object is not iterable. Expected: no exception, but got: An error occurred: ‘NoneType’ object is not iterable.

    Exercise 4

    0/10 points

    Failed test case: editor_agent raised LLMError: An error occurred: ‘NoneType’ object is not iterable. Expected: no exception, but got: An error occurred: ‘NoneType’ object is not iterable.

" This the output code that takes long time to complete at end …only partial pasted here

:hammer_and_wrench: Executing with agent: research_agent on task: Search Wikipedia for the definition and overview of the ensemble Kalman filter

:magnifying_glass_tilted_left: Research Agent

:white_check_mark: Output:
Ensemble Kalman Filter Overview

The ensemble Kalman filter (EnKF) is a recursive filter suitable for problems with a large number of variables, often arising in the discretization of partial differential equations in geophysical models. It originated as a variant of the traditional Kalman filter tailored for large-scale pr

Hi @max_IO - Even I’m seeing the same issue. Were u able to resolve this?