Jupyter Notebook Error for Agentic AI

For Module 2 Graded Lab of the Agentic AI course, I keep getting the below error messages when I submit the assignment. This is despite getting 'All Tests Passed’ when I test the code for each exercise.

Things I have tried include:

  • Kernel → Restart & Clear Output
  • Restore to Original Version and saving the file under a new name
  • Re-run the codes from beginning to end

Is anyone able to help please?

Many thanks in advance! :folded_hands:


Error messages:

Total Score

Try Again・0/30

Exercise 1

0/10

Failed test case: generate_draft raised LLMError: An error occurred: Error code: 400 - {‘error’: {‘message’: “Invalid value for ‘content’: expected a string, got null.”, ‘type’: ‘invalid_request_error’, ‘param’: ‘messages.[0].content’, ‘code’: None}}.
Expected:
no exception,
but got:
An error occurred: Error code: 400 - {‘error’: {‘message’: “Invalid value for ‘content’: expected a string, got null.”, ‘type’: ‘invalid_request_error’, ‘param’: ‘messages.[0].content’, ‘code’: None}}.

Exercise 2

0/10

Failed test case: reflect_on_draft raised LLMError: An error occurred: Error code: 400 - {‘error’: {‘message’: “Invalid value for ‘content’: expected a string, got null.”, ‘type’: ‘invalid_request_error’, ‘param’: ‘messages.[0].content’, ‘code’: None}}.
Expected:
no exception,
but got:
An error occurred: Error code: 400 - {‘error’: {‘message’: “Invalid value for ‘content’: expected a string, got null.”, ‘type’: ‘invalid_request_error’, ‘param’: ‘messages.[0].content’, ‘code’: None}}.

Exercise 3

0/10

Failed test case: revise_draft raised AttributeError: ‘NoneType’ object has no attribute ‘choices’.
Expected:
no exception,
but got:
‘NoneType’ object has no attribute ‘choices’.

clear your kernel output and reconnect kernel

re-run all the cells individually from beginning till end

save your work environment

Now submit.

Let me know if you still encounter same error

Hi Deepti,

After trying multiple methods, include clearing kernel and reconnecting kernel, restart and run all etc etc - this now works. Not without having the ‘submit’ button disappear for a while in the interim!

Thank you very much for your help!

1 Like