L3 error message

I copied from the notebook file and pasted the code in my google colab and I get an error message (see after the code) and I can’t figure out what is wrong.
inputs = {
“customer”: “DeepLearningAI”,
“person”: “Andrew Ng”,
“inquiry”: "I need help with setting up a Crew "
"and kicking it off, specifically "
"how can I add memory to my crew? "
“Can you provide guidance?”
}
result = crew.kickoff(inputs=inputs)

Error message: KeyError Traceback (most recent call last)

in <cell line: 9>() 7 “Can you provide guidance?” 8 } ----> 9 result = crew.kickoff(inputs=inputs)


3 frames

/usr/local/lib/python3.10/dist-packages/crewai/task.py in interpolate_inputs(self, inputs) 221 222 if inputs: → 223 self.description = self._original_description.format(**inputs) 224 self.expected_output = self._original_expected_output.format(**inputs) 225

KeyError: ’ customer’

1 Like

can you share a screenshot of the error?

Also can you confirm if you download all the files from File===>Open section to run all the codes successfully !!!

Sometimes one would require some modifications in your input as the course provided environment has pre defined self recall input functions where as when you run locally codes this can create issue.

Regards
DP

The modifications I made are the following since I am using google colab:

and did you add the utils.py file to the colab directory. This issue wouldn’t have occured in local jupyter, did you try their too?

I did. I mounted to google drive and I did everything necessary. I was able to run L2 with the same codes.

Hi @caebby

ok chances are the key error customer is because the code mentions customer as DeepLearning.AI but as you are running codes by using your API keys there needs to be changes made to the utils py file. I am tagging the L.T for short course @Mubsi or @lucas.coutinho as Mubsi is on leave for few days and not available.

Regards
DP

1 Like

Thanks @Deepti_Prasad for tagging me.

@caebby I will have a look and get back to you as soon as I have an answer.

Thanks
Lucas

1 Like

Looping @lesly.zerna to review this.

1 Like

Hi caebby!
I’ve tested myself using my OpenAI KEY and running in Google Colab and it is working fine :smiley:
See the screenshot (just ignore, the RateLimitError :speak_no_evil::speak_no_evil::speak_no_evil: it’s because of my API key)

Make sure, to copy all steps from the code. I did copy every cell from the notebook into my colab notebook. Also, testing the same in the platform, it is working properly.
running in the platform:

About the KeyError Customer that you’re getting, double check the cells before the inputs, because when we’re defining the tasks: inquiry_resolution and quality_assurance_review, we’ve also referring to this {customer}

Hope this helps, let us know if you make it run!

Happy Learning :smiley:

1 Like

Thank you for your help.
The problem was due to a trailing space in the curly bracket after customer - My code works now.

2 Likes