# Module 3 graded Lab - Error finaltext variable

**URL:** <https://community.deeplearning.ai/t/module-3-graded-lab-error-finaltext-variable/894913>\
**Category:** Agentic AI\
**Tags:** lab-help, week-module-3, dl-ai-learning-platform\
**Created:** [September 2, 2026, 1:50am UTC](https://community.deeplearning.ai/t/module-3-graded-lab-error-finaltext-variable/894913 "2026-09-02T01:50:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohammed\_Ali9](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/mohammed_ali9/32/165695_2.png) [@Mohammed\_Ali9](https://community.deeplearning.ai/u/Mohammed_Ali9)\
**Post date:** [September 2, 2026, 1:50am UTC](https://community.deeplearning.ai/t/module-3-graded-lab-error-finaltext-variable/894913/1 "2026-09-02T01:50:48Z")

</div>

Hi,

I am trying to complete the Graded Labs for Module 3. I keep getting the below error

```auto
Failed test case: generate_research_report_with_tools raised UnboundLocalError: cannot access local variable 'final_text' where it is not associated with a value.
Expected: no exception
Got: cannot access local variable 'final_text' where it is not associated with a value

```

I have not touched any code outside of the section as indicated in the markdown instructions.

Any pointers to resolve this?

Thanks,

---

<div class="post-metadata">

**Author:** ![reinoudbosch](https://avatars.discourse-cdn.com/v4/letter/r/22d042/32.png) [@reinoudbosch](https://community.deeplearning.ai/u/reinoudbosch)\
**Post date:** [September 2, 2026, 8:58am UTC](https://community.deeplearning.ai/t/module-3-graded-lab-error-finaltext-variable/894913/2 "2026-09-02T08:58:39Z")

</div>

Hi Mohammed\_Ali9,

The error message indicates that the variable final\_text has not been assigned a value.

final\_text should be assigned a value in the line:

final\_text = msg.content

Apparently in your case msg does not have a content, which means something has gone wrong with your LLM call. So have a good look and see if you are passing the correct arguments in your chat with the LLM.
