Total beginner here - how do I run the course output on my own laptop?

Just finished watching the crewAI course. I am totally new to programming and would love some help with running this on my own laptop.

  1. I cannot get past this stage (below) as the error message says TypeError: str expected, not NoneType. Does this mean I need to key in my own OpenAI API key?
    openai_api_key = get_openai_api_key()
    os.environ[“OPENAI_MODEL_NAME”] = ‘gpt-3.5-turbo’
    os.environ[“SERPER_API_KEY”] = get_serper_api_key()

  2. If so, how do I do that? Do I just past the key here: get_openai_api_key(here)? And the does the basic account suffice? I tried putting my key in but it ran out of limits immediately.

Thank you so much for your help.

HI @youngh585

can you share a screenshot of this error once?

Hi @youngh585,

At the start of the notebook, there are the library names which you need to install first.

Next, you need an OpenAI API/credits. I doubt a very basic package would be enough for this course, as you may have seen in the course, there’s a lot of back and forth communication which agents do, so “few” credits would run out fast.

You also need Serper API. Fortunately, it offers 2500 free credits to begin with, which are more than enough for you to play with the notebooks.

As for your (1) question, the API keys are passed in a “secretive” manner, you don’t need to do that when running locally. You can replace that code with more straight forward code of passing the API keys.

Hope this helps,
Mubsi

Thank you so much @Deepti_Prasad . Here is the screenshot. I’d love your help on

  1. whether I need to put in my own API key
  2. whether that means I need to get a paying account with openAI
  3. If so, once I have an API key with a paying account, where should I be inserting the key?

I think Mubsi has answered your most of your queries.

your issue is related to the api key only.

if you have your own api key, you can get serper API

Another hot tip: for security purposes, don’t put the actual API keys in the code when you are ready.

Set them up as environment variables. Thankfully, in the code this is actually already partly set up. The other thing to do is to set up the environment variables in your local system.

Try searching ‘Edit System Environment Variable’ in your search bar (in Windows). If it’s not there you can find it this way:

Control Panel (in Windows, and you can search in the search bar for it) → System and Security → System → Advanced System Settings → Environment Variables

Once there, in the System variables section, enter the name (eg. OPEN_AI_KEY) as the Variable and the key itself (eg. y0u11neverfind0utmyc0de!11) as the Value.

I’ve already seen a friend get his API key hacked recently and it hit his monthly limit in a day by whoever managed to get it, so I think this is a good practice!

1 Like

Thank you @Martin_Pollard for this information.

1 Like

Hi there,

Welcome and happy coding!

You need to download the utils.py file by clicking File → Open.
Then create a .env file and save your key(s) there.

Also, try using ChatGPT to help resolve coding issues. Paste the error messages and ask it how to solve. Works great for me!

I am also struggling with how to run the crew shown in the course on my VS code on my macbook. I see that only one file has been created.
I want to install all this on a virtu environment on my laptop and create the files for main, agents, tasks etc and run it my laptop. Can someone help

Hi ashokvas,

Did you manage to sort this out?