Refine the following prompt so that ChatGPT or LLMs can generate improved results. Consider aspects such as grammar, clarity, and detail. If necessary, add more relevant information to the prompt to enhance its effectiveness. Maintain the original style
  
[prompt]
******
i have a dataclass and another class for managing the Data
```
@dataclass
class AppState:
    language: str = None
    repo_url: str = ""
    repo_path: str = ""
    repo_cloned: bool = False
    file_path: str = None
    file_name: str = None
    packages: Dict[str, Any] = field(default_factory=dict)
    complete_methods: Dict[str, Any] = field(default_factory=dict)
    method_name: str = None
    method_definition: str = None
    objective: str = None
    sample_data: Any = None
    test_cases: Dict[str, Any] = field(default_factory=dict)
    test_cases_full: Dict[str, Any] = field(default_factory=dict)
    selected_scenarios: List[Any] = field(default_factory=list)
    pytest_codes: Dict[str, Any] = field(default_factory=dict)
    pytest_results: Dict[str, Any] = field(default_factory=dict)
    langgraph_states: List[Any] = field(default_factory=list)
    questions: List[Any] = field(default_factory=list)
    answers: List[Any] = field(default_factory=list)
    messages_history: List[Any] = field(default_factory=list)
    components: List[Any] = field(default_factory=list)

```
  

from the UI i can update ,language, repo_url, file_path, method_name, 
based on the repo_url list of file_paths will be shown and on the basis of selected file list of method names will be shown. 
if I am updating repo_url i need all variables from dataclass to be reset.
if I am changing file_name i want all variables from file_path to be reset. 
if iam changing method_name i want all variables from method_name to be reset.
if i updating language, i want all variables from file_path to be reset. and rehandle variables from previous repo_url ,file_path.

now modify handle_repo_url, handle_language, handle_file_path, handle_method_name according to the goal given above
```
def handle_repo_url(repo_url, data):
    if not repo_url:
        return data

    if repo_url != data.repo_url:
        repo_path = f"cloned_repos/{repo_url.split('/')[-1]}"
        data.update_and_reset(repo_url=repo_url)
        data.update(repo_path=repo_path)
    else:
        repo_path = data.repo_path

    if os.path.isdir(repo_path):
        data.repo_cloned = True
        return data

    if "username" not in st.session_state and "password" not in st.session_state:
        stc.get_username_password()
    else:
        clone_output = clone_repository(
            repo_url,
            repo_path,
            st.session_state.username,
            st.session_state.password,
        )
        if clone_output:
            data.repo_cloned = True
            logger.info("Repository Cloning : Success !")
        else:
            logger.error("Repository Cloning : Error !")
            stc.toast("Repository Cloning : Error !", type="error")

    return data


def handle_language(language, data):
    if language != data.language:
        data.update_and_reset(language=language)

    return data


def handle_file_path(file_path, data):
    if file_path != data.file_path:
        st.session_state.method_name = None
        if file_path.endswith(".py"):
            file_name = os.path.basename(file_path)
            packages, complete_methods = data.process_file(file_path)
            data.update_and_reset(file_path=file_path)
            data.update(
                file_path=file_path,
                file_name=file_name,
                packages=packages,
                complete_methods=complete_methods,
            )
    else:
        file_name = data.file_name
        packages = data.packages
        complete_methods = data.complete_methods

    return data


def handle_method_name(method_name, data):
    if method_name != data.method_name:
        selected_method_data = find_selected_method(
            nested_dict=data.complete_methods, target_key=method_name
        )
        if selected_method_data is not None:
            method_name, method_definition = selected_method_data
            data.update_and_reset(method_name=method_name)
            data.update(method_name=method_name, method_definition=method_definition)

    else:
        method_definition = data.method_definition

    return data
```
******