# Get\_completion function not defined

**URL:** <https://community.deeplearning.ai/t/get-completion-function-not-defined/433733>\
**Category:** ChatGPT Prompt Engineering for Developers\
**Created:** [September 1, 2023, 4:28am UTC](https://community.deeplearning.ai/t/get-completion-function-not-defined/433733 "2023-09-01T04:28:43Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![STGR81](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@STGR81](https://community.deeplearning.ai/u/STGR81)\
**Post date:** [September 1, 2023, 4:28am UTC](https://community.deeplearning.ai/t/get-completion-function-not-defined/433733/1 "2023-09-01T04:28:43Z")

</div>

text = f"“”  
You should express what you want a model to do by \   
providing instructions that are as clear and \   
specific as you can possibly make them. \   
This will guide the model towards the desired output, \   
and reduce the chances of receiving irrelevant \   
or incorrect responses. Don’t confuse writing a \   
clear prompt with writing a short prompt. \   
In many cases, longer prompts provide more clarity \   
and context for the model, which can lead to \   
more detailed and relevant outputs.  
“”"  
prompt = f"“”  
Summarize the text delimited by triple backticks \   
into a single sentence.  
`{text}`  
“”"  
response = get\_completion(prompt)  
print(response)

In code cell 1 I get the error that get\_completion function is not defined. Can anyone help?

---

<div class="post-metadata">

**Author:** ![gent.spah](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/gent.spah/32/136423_2.png) [@gent.spah](https://community.deeplearning.ai/u/gent.spah)\
**Post date:** [September 1, 2023, 10:52am UTC](https://community.deeplearning.ai/t/get-completion-function-not-defined/433733/2 "2023-09-01T10:52:20Z")

</div>

Perhaps you have forgotten to run some previous cells, can you re run the entire notebook from scratch.

---

<div class="post-metadata">

**Author:** ![STGR81](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@STGR81](https://community.deeplearning.ai/u/STGR81)\
**Post date:** [October 1, 2023, 6:09pm UTC](https://community.deeplearning.ai/t/get-completion-function-not-defined/433733/3 "2023-10-01T18:09:12Z")

</div>

The same problem happens in all code cells. Just see this

 ![Capture](https://global.discourse-cdn.com/dlai/original/3X/0/9/09f15d143bd342c2be4df574fc57baed006bee0c.png)  
 ![Capture2](https://global.discourse-cdn.com/dlai/original/3X/5/4/54cc73adb98f29385eeccd9c6a7f80c377cbbdd8.png)

---

<div class="post-metadata">

**Author:** ![elirod](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/elirod/32/55842_2.png) [@elirod](https://community.deeplearning.ai/u/elirod)\
**Post date:** [October 1, 2023, 6:13pm UTC](https://community.deeplearning.ai/t/get-completion-function-not-defined/433733/4 "2023-10-01T18:13:43Z")

</div>

Hi @STGR81

Are you using some kind of VPN or something like that?

Looks like you have some network troubles

I did a couple tests and everything work just fine for me

---

<div class="post-metadata">

**Author:** ![STGR81](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@STGR81](https://community.deeplearning.ai/u/STGR81)\
**Post date:** [October 1, 2023, 6:26pm UTC](https://community.deeplearning.ai/t/get-completion-function-not-defined/433733/5 "2023-10-01T18:26:30Z")

</div>

![Capture2](https://global.discourse-cdn.com/dlai/original/3X/5/4/54cc73adb98f29385eeccd9c6a7f80c377cbbdd8.png)  
This is the problem which I’m facing

Here is another problem

 ![image](https://global.discourse-cdn.com/dlai/original/3X/f/d/fd920add6934af3d98a8c274eeac6f60d601446c.png)

My wireless internet connection is not working in my computer so I have to use a wired router. Since the code cells aren’t working, I’m following the videos only. My computer is Windows 7 if you want to know. Maybe because of that I’m having a problem. I had a computer that was originally Windows 10 and later I upgraded to 11 but it’s not working.

---

<div class="post-metadata">

**Author:** ![STGR81](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@STGR81](https://community.deeplearning.ai/u/STGR81)\
**Post date:** [October 1, 2023, 6:28pm UTC](https://community.deeplearning.ai/t/get-completion-function-not-defined/433733/6 "2023-10-01T18:28:49Z")

</div>

This is the main problem I’m focusing on

 ![image](https://global.discourse-cdn.com/dlai/original/3X/5/9/595f6a9074fd65c70a0ece23c2f736df813beafc.png)

---

<div class="post-metadata">

**Author:** ![STGR81](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@STGR81](https://community.deeplearning.ai/u/STGR81)\
**Post date:** [October 1, 2023, 6:29pm UTC](https://community.deeplearning.ai/t/get-completion-function-not-defined/433733/7 "2023-10-01T18:29:25Z")

</div>

It says prod\_review is not defined

---

<div class="post-metadata">

**Author:** ![STGR81](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@STGR81](https://community.deeplearning.ai/u/STGR81)\
**Post date:** [October 1, 2023, 6:32pm UTC](https://community.deeplearning.ai/t/get-completion-function-not-defined/433733/8 "2023-10-01T18:32:19Z")

</div>

Most of the code cells that have an error say that the name is not defined.

---

<div class="post-metadata">

**Author:** ![elirod](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/elirod/32/55842_2.png) [@elirod](https://community.deeplearning.ai/u/elirod)\
**Post date:** [October 1, 2023, 7:21pm UTC](https://community.deeplearning.ai/t/get-completion-function-not-defined/433733/9 "2023-10-01T19:21:07Z")

</div>

The error

“`get_completion` is not define”

is suggesting that the cell code where the `get_completion()` is wasn’t run properly.

So, the interpreter is complaining that you want to execute a function that doesn’t exists in the memory.

This may cause a lot of issues, because every function or package depends each other.

My suggests for you is, restart the kernel and try to run all the cells one by one, from top to bottom.

Regards your windows version. This might not be something that could affect the lab cause the platform is web based.

Of course, if you intend to run the lab locally, you have to deal we all the packages installations by your own.

---

<div class="post-metadata">

**Author:** ![STGR81](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@STGR81](https://community.deeplearning.ai/u/STGR81)\
**Post date:** [October 8, 2023, 7:04pm UTC](https://community.deeplearning.ai/t/get-completion-function-not-defined/433733/10 "2023-10-08T19:04:34Z")

</div>

Restarting the kernel and running all the cells one by one worked. Thank you for your help.

---

<div class="post-metadata">

**Author:** ![elirod](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/elirod/32/55842_2.png) [@elirod](https://community.deeplearning.ai/u/elirod)\
**Post date:** [October 8, 2023, 7:06pm UTC](https://community.deeplearning.ai/t/get-completion-function-not-defined/433733/11 "2023-10-08T19:06:06Z")

</div>

You welcome @STGR81

Have a great learning

---

<div class="post-metadata">

**Author:** ![elirod](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/elirod/32/55842_2.png) [@elirod](https://community.deeplearning.ai/u/elirod)\
**Post date:** [October 8, 2023, 7:07pm UTC](https://community.deeplearning.ai/t/get-completion-function-not-defined/433733/12 "2023-10-08T19:07:28Z")

</div>

Don’t forget to mark my answer as a solution. This action will move the answer to the top of the discussion and may help other learners.

Thanks!
