RHC4EVER
RHC4EVER

Reputation: 43

I am new to VSCode, Python, and the OpenAI API, and I am unable to figure out how to access the hover documentation

Every video I watch shows documentation when the user hovers over code, yet mine is nearly empty.

Example:

response = openai.Completion.create(engine="text-davinci-001", prompt=prompt, max_tokens=6)

If I hover over "create" it shows "create: Any" inside the pop-up window. This is much less descriptive than what I see in tutorials.

How do I access documentation on a given object from within VSCode?

I have tried installing/reinstalling Python, IntelliCode and Docs View from inside VSCode. IntelliCode does add links to GitHub but still no the standard documentation like I was expecting.

Upvotes: 0

Views: 1165

Answers (1)

MingJie-MSFT
MingJie-MSFT

Reputation: 9417

What you want is called Intellisense which is provided by extension Python and Pylance.

So the first step is to ensure that you have installed these two extensions.

Because the Intellisense is obtained from the description file in the package, and your code does not have the statement to import the package, I guess you did not install the package or import it. You have to use command pip install openai in the terminal and use the correct codes to get it:

import openai
response = openai.Completion.create(engine="text-davinci-001", prompt=prompt, max_tokens=6)

enter image description here

Upvotes: 1

Related Questions