TypeError: IndexModel._from_openapi_data() missing 5 required positional arguments: 'name', 'dimension', 'metric', 'host', and 'spec'

Hi,

I am in the first week and getting the following error message:

TypeError: IndexModel._from_openapi_data() missing 5 required positional arguments: ‘name’, ‘dimension’, ‘metric’, ‘host’, and ‘spec’

What does this mean, please? I stopped the video where the lecturer types in the code and it is exactly the same. However, I am not able to run it.

Please help.

Thanks,

Naveen

1 Like

Could you share a screenshot about the issue you are talking about. You can share codes image for this assignment here in case it is not part of any grading assignment. Also by your comments seems like you are writing codes in your local jupyter notebook, so you need to understand the video shows the codes exactly as you wrote but still don’t have access to the utils file or metadata files for you to run the codes.

Hi @Deepti_Prasad ,

Thanks for your swift response.

Please see a screenshot.

re.: “Also by your comments seems like you are writing codes in your local Jupyter notebook,” => I am doing all this in my browser

At some I do want to run this on my desktop. Please can you give instructions for this?

Thanks,

Naveen

1 Like

Notice that Index Name = which is created from utils from dl_ai API key, that you didn’t have and which was created using openai API key, so it throws this error.

Either you need to find the utils/metadata file for codes you are writing, or write your metadata for codes to work in your local jupyter notebook. If you can find any GitHub link to the particular codes you are mentioning you should be able to get the required/metadata files.

Regards
DP

Hi Deepti,

Thanks for your response. I am not sure if I was clear here. Currently I am doing this course in the browser:

Please see a screen shot where it shows that my code is the same is the lecturer. Perhaps that make the error message clear.

RE.: “Notice that Index Name = which is created from utils from dl_ai API key, that you didn’t have and which was created using openai API key” => are you saying I should have an open API key first? But nowhere in the video does that say?

1 Like

in the environment provided by Deep learning.ai and coursera??

or your local Jupyter notebook?

because your image does show you are running the Lesson 2 in your local Jupyter environment.

If you are doing the course still, you need to run in the same environment provided by the course platform and not download the assignment and then run on local Jupyter.

When I opened that lesson and ran the first four cells, I got exactly the same error message, using the DLAI-provided course environment.

1 Like

Then if this is the issue, probably @Mubsi need to be notified.

Mubsi can you have a look here please.

Regards
DP

1 Like

I got the same error and looking for a fix

1 Like

Hello @Mubsi

Although the post creator had issue with Lesson_2_Retrieval Augmented Generation related to the pinecone index error, I had same error for Lesson_1 Semantic Search.

So I guess this is error needs attention from the QA team as it mentions issue is related to openai data missing

Regards
DP

I have run into the same problem (pinecone index error). Note that I am running the environment provided by Deep learning.ai and not locally.

2 Likes

Hi @Deepti_Prasad and everyone,

Thank you for bringing this to my attention. The team has been informed about this. I shall let you know when this has been fixed.

Best,
Mubsi

2 Likes

+1 : Running into same issue.

1 Like

Hi everyone,

The OPENAI_API_KEY is not loaded into the environment.
So here’s my solution (line 15).

Tested and running locally in my laptop(with my own .env file).

1 Like

Terrence it worked??

Yes, with my own OpenAI and Pinecone keys in my local environment. :slight_smile:

2 Likes

great, thanks for helping all learners!!!

Regards
DP

1 Like

So aren’t you guys going to fix on dlai platform ? Since, lot of us don’t have OpenAI and Pinecone API keys

1 Like

Why do you believe DLAI isn’t working on a fix for this?

1 Like

I will be honest about this Rahul, short courses don’t actually allow learners access to GitHub repo or metadata file. So if you ask me honestly about addressing API issue locally for learners, they might provide you information about how to get the API but not provide you dlai api keys.

I am tagging Staff, so he checks your response.

@Mubsi can you confirm on the learner’s issue here please. Thank you.

Regards
DP