ImportError: cannot import name 'get_prebuilt_trulens_recorder' from 'utils'

I am getting the error:

ImportError: cannot import name 'get_prebuilt_trulens_recorder' from 'utils'

when I run the line

from utils import get_prebuilt_trulens_recorder

2 Likes

I’m also getting this error when I run locally. Does anybody have suggestions?

I had the same mistake in Colab. Go to the RAG Tutorial from deeplearning.ai and copy the content of the utils.py file from there, which is in the same folder as the code, the book, and the questions. Paste the code in Colab before the line of the get_prebuilt_trulens_recorder (remove here also the import utils statement). For me, it forgot about the API key in the beginning, so I adapted the function “def_openai_api_key()” in the copied code to

openai_api_key = "Your key goes here"
def get_openai_api_key():
    return openai_api_key
1 Like