I made an error when I used bioblend's api to download the output

Hi!I made an error when I used bioblend’s api to run the workflow and download the output. Can you help me have a look? How to modify it?
The display error is as follows:
Traceback (most recent call last):
File “C:\Users\dongge\PycharmProjects\meta.py”, line 143, in
main()
File “C:\Users\dongge\AppData\Local\Programs\Python\Python311\Lib\site-packages\gooey\python_bindings\gooey_decorator.py”, line 134, in
return lambda *args, **kwargs: func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\dongge\PycharmProjects\meta.py”, line 141, in main
download_history(gi, history_id, output_dir)
File “C:\Users\dongge\PycharmProjects\meta.py”, line 137, in download_history
r.raise_for_status()
File “C:\Users\dongge\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\models.py”, line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://usegalaxy.org/histories/a03bd9fd371ae609/exports/history
Part of my code is as follows:
workflow_id = ‘794e860a6428bb70’

invocation = gi.workflows.invoke_workflow(workflow_id, inputs=inputs, inputs_by="name", history_id=history_id)

def get_status(gi: "GalaxyInstance", history_id: str) -> Dict[str, Any]:
    history = gi.histories.show_history(history_id)
    state: Dict[str, Any] = {
        "state": history["state"],
    }

    if history.get("state_details") is not None:
        state["state_details"] = history["state_details"]
        total_complete = sum(history["state_details"].values())
        if total_complete > 0:
            state["percent_complete"] = 100 * history["state_details"]["ok"] / total_complete
        else:
            state["percent_complete"] = 0
    return state

while True:
    status = get_status(gi, history_id)
    if status["state"] == "ok":
        break
    time.sleep(10)

def download_history(gi: HistoryClient, history_id: history_id, output_dir: str,chunk_size: int = bioblend.CHUNK_SIZE) -> None:
    url = gi.base_url + f"/histories/{history_id}/exports/history"
    r = gi.make_get_request(url, stream=True)
    r.raise_for_status()
    with open(os.path.join(output_dir, f"{history_id}.tar.gz"), "wb") as outf:
        for chunk in r.iter_content(bioblend.CHUNK_SIZE):
            outf.write(chunk)
download_history(gi, history_id, output_dir)