# C1M5 Programming Assignment: 4.1 Exercise 1: No response generated for simplified=True function calls

**URL:** <https://community.deeplearning.ai/t/c1m5-programming-assignment-4-1-exercise-1-no-response-generated-for-simplified-true-function-calls/890362>\
**Category:** Retrieval Augmented Generation\
**Tags:** week-module-5, coursera-platform\
**Created:** [March 15, 2026, 5:47pm UTC](https://community.deeplearning.ai/t/c1m5-programming-assignment-4-1-exercise-1-no-response-generated-for-simplified-true-function-calls/890362 "2026-03-15T17:47:55Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![sriharishj](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@sriharishj](https://community.deeplearning.ai/u/sriharishj)\
**Post date:** [March 15, 2026, 5:47pm UTC](https://community.deeplearning.ai/t/c1m5-programming-assignment-4-1-exercise-1-no-response-generated-for-simplified-true-function-calls/890362/1 "2026-03-15T17:47:55Z")

</div>

In Exercise 1 of the Module 5 assignment, I added a simplified prompt in the graded code area and executed the code, the unit testcase run and the subsequent test fails with `UnboundLocalError: cannot access local variable ‘response’ where it is not associated with a value`.

I have noticed that this happens primarily for simplified=True function calls.

I tried to manually execute the function `check_if_faq_or_product` , the no response issue pops up only when simplified is set to True.

Call: `check_if_faq_or_product(‘How can I contact the user support?’, False)`

Result: `(‘FAQ’, 220)`

Call: `check_if_faq_or_product(‘How can I contact the user support?’, True)`

Result:

```auto
UnboundLocalError Traceback (most recent call last)
Cell In[33], line 99
96 label = ‘undefined’
98 return label, total_tokens
—> 99 check_if_faq_or_product(‘How can I contact the user support?’, True)

Cell In[33], line 85, in check_if_faq_or_product(query, simplified)
81 router_span.set_status(Status(StatusCode.OK))
84 # Get the Label by accessing the content key of the response dictionary
—> 85 label = response[‘choices’][0][‘message’][‘content’]
86 total_tokens = response[‘usage’][‘total_tokens’]
87 span.set_output(str({“label”: label, ‘total_tokens’:total_tokens}))

UnboundLocalError: cannot access local variable ‘response’ where it is not associated with a value

```

I wonder if the tracer is broken somehow. Specifically this code’s execution:

```auto
with tracer.start_as_current_span("routing_faq_or_product", openinference_span_kind = 'tool') as span:
    span.set_input(str({"query":query, "simplified": simplified}))

```

I tried to skip the 1.4 Optional Telemetry setup to prevent the tracer issues, but realized that’s not possible as tracer is a necessary variable to run 4.1 exercise. So is 1.4 mandatory and not optional, unlike the title says?

Please find the Lab ID and the error messages below.

> LAB ID: qrbdmogghssj

Response of Unit Test cases:

```auto
Failed test case: check_if_faq_or_product raised an exception with the following parameters query = What are your working hours?.
Expected: check_if_faq_or_product must run without exceptions
Got: cannot access local variable 'response' where it is not associated with a value

```

Running the following unedited test `Let’s test both versions` code:

```auto
queries = [
‘What is your return policy?’,
‘Give me three examples of blue T-shirts you have available.’,
‘How can I contact the user support?’,
‘Do you have blue Dresses?’,
‘Create a look suitable for a wedding party happening during dawn.’
]

labels = [‘FAQ’, ‘Product’, ‘FAQ’, ‘Product’, ‘Product’]

for query, correct_label in zip(queries, labels):
# Call check_if_faq_or_product and store the results
response_std, tokens_std = check_if_faq_or_product(query, simplified=False)
response_simp, tokens_simp = check_if_faq_or_product(query, simplified=True)

# Print results
process_and_print_query(query, correct_label, response_std, tokens_std, response_simp, tokens_simp)

```

Result:

```auto
UnboundLocalError Traceback (most recent call last)
Cell In[20], line 14
     11 for query, correct_label in zip(queries, labels):
     12 # Call check_if_faq_or_product and store the results
     13 response_std, tokens_std = check_if_faq_or_product(query, simplified=False)
---> 14 response_simp, tokens_simp = check_if_faq_or_product(query, simplified=True)
     16 # Print results
     17 process_and_print_query(query, correct_label, response_std, tokens_std, response_simp, tokens_simp)

Cell In[18], line 85, in check_if_faq_or_product(query, simplified)
     81 router_span.set_status(Status(StatusCode.OK))
     84 # Get the Label by accessing the content key of the response dictionary
---> 85 label = response['choices'][0]['message']['content']
     86 total_tokens = response['usage']['total_tokens']
     87 span.set_output(str({"label": label, 'total_tokens':total_tokens}))

UnboundLocalError: cannot access local variable 'response' where it is not associated with a value

```

---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/165831_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [March 15, 2026, 5:57pm UTC](https://community.deeplearning.ai/t/c1m5-programming-assignment-4-1-exercise-1-no-response-generated-for-simplified-true-function-calls/890362/2 "2026-03-15T17:57:35Z")

</div>

hi @sriharishj

is this the first exercise test result?

can you DM me screenshot of your codes by personal DM.

Also just to be sure, I hope you know there were changed made to labs multiple times due to multiple issue arising from deprecated model. So before you started, did you make sure to get updated notebook by rebooting and clicking Get the latest version??

Also in the section where you provided queries and then labels. Don’t mention labels in separate line, rather mention for each query you wrote, next to it mention if it is FAQ or product label, something like this

Do you have blue dress? Label: Product

Regards  
Dr. Deepti

---

<div class="post-metadata">

**Author:** ![sriharishj](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@sriharishj](https://community.deeplearning.ai/u/sriharishj)\
**Post date:** [March 15, 2026, 7:35pm UTC](https://community.deeplearning.ai/t/c1m5-programming-assignment-4-1-exercise-1-no-response-generated-for-simplified-true-function-calls/890362/3 "2026-03-15T19:35:29Z")

</div>

Hi @Deepti_Prasad,

Thank you for your quick response.

Yes, this is the First exercise’s test result.

I did delete all the files (to make sure they got updated), rebooted and got the latest version before submitting my query here. I did redo it a couple times with clearing my browser cache to verify and the issue still persists.

I’ll send over the screenshots via DM now.

Those queries and labels mentioned are not my code, but rather an un-editable code section present after the 1st exercise’s unit test function call. I have mentioned the examples in my prompt as per your recommendation. Thank you for pointing it out anyways.

Regards,  
Sri Harish

---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/165831_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [March 15, 2026, 7:39pm UTC](https://community.deeplearning.ai/t/c1m5-programming-assignment-4-1-exercise-1-no-response-generated-for-simplified-true-function-calls/890362/4 "2026-03-15T19:39:50Z")

</div>

hi @sriharishj

please follow this thread response

> [@C1M5 Error code: 400 - {"message": "Unable to access non-serverless model meta-llama/Llama-3.2-3B-Instruct-Turbo](https://community.deeplearning.ai/t/c1m5-error-code-400-message-unable-to-access-non-serverless-model-meta-llama-llama-3-2-3b-instruct-turbo/890014/13):
>
> hi @christophomos I just check the lab, looks like a new issue with json load is using together api key, and it is throwing exception when recalling the meta llama. We will have to wait for @lucas.coutinho to resolve this issue. Regards Dr. Deepti

It is a new exception which I even I experienced. I have reported issue to staff, but will have to wait when they(@lucas.coutinho ) look at the report once their weekday starts in their respective timeline.

regards  
Dr. Deepti

---

<div class="post-metadata">

**Author:** ![sriharishj](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@sriharishj](https://community.deeplearning.ai/u/sriharishj)\
**Post date:** [March 15, 2026, 7:40pm UTC](https://community.deeplearning.ai/t/c1m5-programming-assignment-4-1-exercise-1-no-response-generated-for-simplified-true-function-calls/890362/5 "2026-03-15T19:40:41Z")

</div>

Alright, will do so. Thank you.

---

<div class="post-metadata">

**Author:** ![lucas.coutinho](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/lucas.coutinho/32/155465_2.png) [@lucas.coutinho](https://community.deeplearning.ai/u/lucas.coutinho)\
**Post date:** [March 16, 2026, 8:02pm UTC](https://community.deeplearning.ai/t/c1m5-programming-assignment-4-1-exercise-1-no-response-generated-for-simplified-true-function-calls/890362/6 "2026-03-16T20:02:06Z")

</div>

Hi!

Thanks for tagging me @Deepti_Prasad!

This issue happened due to a deprecated model, which has been fixed. You can close and open the assignment to fetch the fixed version.

Cheers,  
Lucas

---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/165831_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [March 16, 2026, 8:05pm UTC](https://community.deeplearning.ai/t/c1m5-programming-assignment-4-1-exercise-1-no-response-generated-for-simplified-true-function-calls/890362/7 "2026-03-16T20:05:50Z")

</div>

@lucas.coutinho

I have tagged you in more posts. please check the mentor lounge topic related to rag

Regards  
Dr. Deepti

---

<div class="post-metadata">

**Author:** ![sriharishj](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@sriharishj](https://community.deeplearning.ai/u/sriharishj)\
**Post date:** [March 21, 2026, 4:38pm UTC](https://community.deeplearning.ai/t/c1m5-programming-assignment-4-1-exercise-1-no-response-generated-for-simplified-true-function-calls/890362/8 "2026-03-21T16:38:13Z")

</div>

The latest version is working now, thank you.

---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/165831_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [March 22, 2026, 6:17pm UTC](https://community.deeplearning.ai/t/c1m5-programming-assignment-4-1-exercise-1-no-response-generated-for-simplified-true-function-calls/890362/10 "2026-03-22T18:17:54Z")

</div>



---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/165831_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [March 22, 2026, 6:19pm UTC](https://community.deeplearning.ai/t/c1m5-programming-assignment-4-1-exercise-1-no-response-generated-for-simplified-true-function-calls/890362/11 "2026-03-22T18:19:49Z")

</div>

@sriharishj

your latest error looks more to check with your codes than general lab issues which currently rag labs is experiencing.

please check your codes again.

this looks like your prompts need more option to choose between to get response as you mentioned only single examples with each label category.

---

<div class="post-metadata">

**Author:** ![sriharishj](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@sriharishj](https://community.deeplearning.ai/u/sriharishj)\
**Post date:** [March 22, 2026, 6:40pm UTC](https://community.deeplearning.ai/t/c1m5-programming-assignment-4-1-exercise-1-no-response-generated-for-simplified-true-function-calls/890362/12 "2026-03-22T18:40:59Z")

</div>

You are right, thank you. Adding additional examples and restarting the Kernel, fixed the response error. Thank you again.

---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/165831_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [March 22, 2026, 7:11pm UTC](https://community.deeplearning.ai/t/c1m5-programming-assignment-4-1-exercise-1-no-response-generated-for-simplified-true-function-calls/890362/13 "2026-03-22T19:11:00Z")

</div>

great 👏👏

for label category related prompt, i always provide minimum of 3 prompt examples for each label categories.

Remember "“the more refined your prompt is, resulting in better response with the context window choice for llm response.

leaving this thread open, in case you get any further error related to this selected lab, post the error screenshot error without posting any codes here.(based on community guidelines)

Good luck!

Keep Learning!

Regards

Dr. Deepti

---

<div class="post-metadata">

**Author:** ![dpritham](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/dpritham/32/164589_2.png) [@dpritham](https://community.deeplearning.ai/u/dpritham)\
**Post date:** [September 14, 2026, 10:23pm UTC](https://community.deeplearning.ai/t/c1m5-programming-assignment-4-1-exercise-1-no-response-generated-for-simplified-true-function-calls/890362/14 "2026-09-14T22:23:25Z")

</div>

I am getting this exact same error. What is going on? I have restarted the kernel. At one point it the model was giving me wrong classifications. May be that is tuning of the prompt. But this error here is very frustrating:

* * *

UnboundLocalError Traceback (most recent call last)  
Cell In[19], line 1  
----\> 1 unittests.test\_check\_if\_faq\_or\_product(check\_if\_faq\_or\_product)

File ~/work/unittests.py:98, in test\_check\_if\_faq\_or\_product(learner\_func)  
87 cases.append(t)  
90 return cases  
—\> 98 cases = g()  
99 print\_feedback(cases)

File ~/work/unittests.py:72, in test\_check\_if\_faq\_or\_product..g()  
70 for query, correct\_label in zip(queries, labels):  
71 t = test\_case()  
—\> 72 response, total\_tokens = learner\_func(query, simplified = True)  
73 label = response  
74 if label != correct\_label:

Cell In[18], line 81, in check\_if\_faq\_or\_product(query, simplified)  
77 router\_span.set\_status(Status(StatusCode.OK))  
80 # Get the Label by accessing the content key of the response dictionary  
—\> 81 label = response[‘choices’][0][‘message’][‘content’]  
82 total\_tokens = response[‘usage’][‘total\_tokens’]  
83 span.set\_output(str({“label”: label, ‘total\_tokens’:total\_tokens}))

UnboundLocalError: cannot access local variable ‘response’ where it is not associated with a value

Also, is 1.4 optional or not?

---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/165831_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [September 15, 2026, 2:20am UTC](https://community.deeplearning.ai/t/c1m5-programming-assignment-4-1-exercise-1-no-response-generated-for-simplified-true-function-calls/890362/15 "2026-09-15T02:20:19Z")

</div>

hello @dpritham

Looks like you are old user and yet you have posted on an older thread. kindly always post a new topic with your failed unittest screenshot. you can always sharing Link of the similar post matching to your problem.

even though error might be similar, the cause of the same error will vary from different code implementation.

Your error surely points for a code review, so please click on my name and then message me code screenshots for your failed unittest.

Regards  
Dr. Deepti
