And you think an llm can generate code to use an undocumented library? :D
Obviously, if the library or code using it weren't part of the training data, and you don't supply either in the context of your request, then it won't generate valid code for it. But that's not LLM's fault.
You can imagine the classic attention mechanism as a lookup table, actually.
Transformers are layers and layers and layers of lookup tables.