8000 Problem with handling a WS connection break between the server and the LLM · Issue #1105 · google/adk-python · GitHub
[go: up one dir, main page]

Skip to content
Problem with handling a WS connection break between the server and the LLM #1105
Open
@NikitaZemtsov

Description

@NikitaZemtsov

Use runner.run_live with gemini model

Sometimes there is a WS connection break between the server and the LLM.

Image

The problem is that connection closure processing does not involve closing the LiveRequestQueueue queue.

Image

That is, the queue continues to exist and receive messages, but the consumer is no longer there. Looking through the code I realized that at the moment there is no way to determine whether the connection is broken or not.
It would be nice to add a 'closed' flag to LiveRequestQueue and set it when the connection is closed. And add a custom LiveRequestQueueClosed error when invoke get or send (send_content ...).
Such a solution will allow to implement the check, and recreate the runner instance when the connection is lost.

I saw a note that shotdown is planned to be added. But in fact the 'closed' flag solves the problem completely, because you can recreate the runner with the same queue or create a new one. And we dont depend on python version.

Image

I tried to think of a crutch. But so far I have not been able to get to the WS instance to implement the check. Please advise me on a temporary solution.

Reproduse:
Run runner
Turn off the internet
Wait connection close
Send new message

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0