From helper_functions import print_llm_response

Hi

Please, the following line of code is not working on my python.

from helper_functions import print_llm_response

How can I make it run as I am practicing with python 3.9.5.

Thanks.

Hi Idris, welcome to the community!

This thread is about “How to have helper_functions in Python”: How to have helper_functions in python.

I hope this solves your problem!

1 Like

Hi Idris,

If you are running in your computer, make sure you have helper_functions download in your project folder or current working folder. To download helper_functions from course, go to file → open → (in jupyter) open helper functions (by double clicking) → file → download (to your working folder). hope it helps.

3 Likes

Many thanks for your reply.

I have downloaded the helper_functions.py file and placed it in the same folder with the practice files, but the following error message pop up after the running the code.

Traceback (most recent call last):
File “D:\My edX\AI for Python\llm_tutorial.py”, line 1, in
from helper_functions import print_llm_response
File “D:\My edX\AI for Python\helper_functions.py”, line 4, in
from openai import OpenAI
ModuleNotFoundError: No module named ‘openai’

How can I resolve this?

Thanks

Perhaps you are missing the openai package.

Please I need help on step by step process to resolve this. I want get this resolved before moving to the next course

Is the missing openai package a paid service?

Waiting for your prompt response.

Many thanks

I believe you can get the openai package from pypi, using pip.

Note that installing a DLAI course to run on your local platform is up to you. There are too many platforms and configurations for DLAI volunteers to give individual instructions.

1 Like