This invention discloses a Python dependency
library API migration method based on a large
language model. This method employs a multi-proxy strategy based on the large
language model to simulate and automate the process of a
programmer migrating an API. Using unstructured
web page data easily accessible online, the method performs five steps:
user intent recognition, network resource discovery, random walk-based information gathering, migration, and testing and
verification. Ultimately, it migrates the user-specified dependency
library API from the user-provided code. The multi-proxy strategy allows the large
language model to perform well on complex tasks like API migration, while the
intent recognition and testing and
verification steps effectively control unreliable outputs caused by the large language model illusion problem. This invention can be applied to
software engineering tasks such as code updates,
code refactoring, and legacy code handling, helping to reduce human costs in
software development and maintenance.