Conventional intent-driven networks (IDNs) rely on static templates to translate declarative intents into imperative network configurations. However, the dynamic nature of network environments and evolving user requirements pose significant challenges to these inflexible approaches. With the rapid advancement of generative artificial intelligence (GenAI), there have been approaches in IDNs that have attempted to leverage large language models (LLMs) for intent translation. Despite their promising preliminaries, these efforts generally employ few-shot learning techniques, which are often inadequate in scenarios where new or complex intents surpass the capabilities of the limited training examples. To overcome these limitations, we introduce a Generative Intent Abstraction (GIA) framework, which leverages LLMs with knowledge-enhanced prompting techniques to dynamically generate adaptable intent graphs by compelling the LLMs to write Python codes. Furthermore, we reformulate the intent negotiation into a subgraph isomorphism problem (SIP), ensuring the generated graphs continuously comply with the network capabilities. Experimental results on the network intent dataset from easy and medium levels to hard and previously unseen levels demonstrate the effectiveness and adaptability of the proposed GIA framework. It significantly outperforms traditional methods without knowledge augmentation, achieving more than 30% higher F1 score for medium-level intents and a significant 180% increase for previously unseen intents.