Best practice for providing python library context

I’m using a library (dspy, if it matters) that doesn’t present its API in a single webpage and some of the code examples seem to be out of date, but overall are fairly recent. I’ve installed the library using pip. However, cursor.sh is proposing imports that don’t exist in the library.

I’ve added a soft link to the root directory that cursor.sh is working out of, reindexed it in hopes that it would be smarter about what could and could not be imported.

What’s best practice for making cursor.sh more deeply understand a python package that has mostly consistent documentation but is installed and lintable – where the linting should suggest what imports are in fact false.

1 Like

Okay, so first step is to

python -c "import agentjo; print(agentjo.__file__)" ← or your library

Then, soft link it
ln -s /Users/XYZ/Downloads/GAIA/venv/lib/python3.11/site-packages/agentjo/ agentjo_package

Then in the IDE open the folder to trigger the ‘index new and opened folders’ codebase behavior.

Then you can @ files and directories. What you do is @ them when dev’ing code involving the library. This should greatly help against unexpected argument/method/etc error.