Unable to use models-api (language model) in Function

When I import the models-api in a function, I get the error Cannot find module '@foundry/models-api/language-models' or its corresponding type declarations.typescript(2307). I have set enableModelFunctions to true in my functions.json file and have also tried setting enableExternalSystems to true as per the documentation. I also have permissions to use language models. Any help would be greatly appreciated, thanks in advance!

Have you imported the language models you’d like to use from the resource imports panel on the left-hand side (as described on this page)?

Yes, but I am still unable to use the module.