Helper functions (original) (raw)

January 17, 2025, 10:49am 1

I want to know the differences between print_llm_response and get_llm_response. To me both looks same hence it’s confusing me.

Regards,
Ravi Verma

Mubsi January 17, 2025, 12:01pm 2

Hi @adminravi,

Both the functions are 99% the same. The only difference is, as the name implies print_llm_response, prints the response of the llm.

get_llm_response returns you the response in a variable and you then can print that variable.

The reason for these two functions to be separate is based off the use case of the response.

Sometimes, you just want the response to be printed. Other times, you want to further do something with the response.

adminravi January 17, 2025, 12:11pm 3

Thank you so much. So if I need the response for further processing, I will use get_llm_response and store it in some variable. And if I just need to display the response, I will use print_llm_response.

Mubsi January 17, 2025, 12:14pm 4

Exactly!

adminravi January 17, 2025, 12:19pm 5

This is great. My personal opinion is that apart from using the inbuilt helper_functions. If this course would have taught us how to use frameworks like LangChain, it would have been even more interesting.

Mubsi January 17, 2025, 12:22pm 6

We have other short courses for this if you are interested. Feel free to explore our short course catalog.

adminravi January 17, 2025, 12:30pm 7

After completing this course, which course do you suggest I should take. I want to work in the data science field and presently undergoing the Great Andrew NG’s course 2 on machine learning (advanced algorithms neural networks) also undergoing your courses on linear algebra, calculus and probability & statistics. I am somewhat comfortable in Python, I want to know after this course, which short course should I take that will help in my career path. I will be grateful for your pointed reply.

Hi again, I want to experiment more with the helper_function on my computer. From where can I download the helper_function? Moreover, downloading the helper_functions file into my working directory will make my jupyter notebook codes work like it does in your jupyter notebook terminal? Kindly guide.

Mubsi January 20, 2025, 11:27am 9

Hi @adminravi,

I should add that I’m not the best person to ask this from. Maybe take the Deep Learning specialisation after completing the courses you are taken, after which you’ll be quite familiar this field and can then make an easy transition to becoming a data scientist.

Mubsi January 20, 2025, 11:30am 10

Hi @adminravi,

Yes and no.

Yes, the code will be the same, and after you set up your local environment, the code should behave the same.

No, for get llm function and print llm function, you’d need to use your own Open AI API key when running the labs locally.

If you are downloading the helper files from Coursera, they include instructions on the changes needed for those two function to work locally.

Best,
Mubsi

Does anyone know if it is possible to download the helper_functions so we can write programs locally?

Mubsi May 5, 2025, 5:08am 12

Hi @sonnyskaa,

Please read this thread.

Best,
Mubsi

Thank you so much for your help! Does the course provide a generic API key that we can use? I ask because, without a paid account, I’m unable to access the LLMs.

Mubsi May 6, 2025, 5:09am 14

Hi @sonnyskaa,

The API keys are only available for use in the course. If you wish to run the notebooks outside of the course platforms, you’d need your own API key.

Best,
Mubsi

Thank you for the quick turnaround and explanation. Is this true in general for all courses? That the material can be downloaded, but API_KEY or other elements are not able to be run using local terminal?

Mubsi May 7, 2025, 7:43am 16

Yes, for all courses on our platform, unless otherwise specified within the course, have embedded API keys in them for you to be able to run the notebooks on our platform.

If you wish to download all the material, which you can, by following the instructions I shared with you, and run the notebooks locally or someplace else, you need to have your own API keys for the services being used in the notebooks.