Package 

Class AIClientToolRunner


  • 
    public final class AIClientToolRunner
    
                        

    Runs the client tool calls addressed to this device, each once.

    Give it each AI reply's steps as they update. It runs a call when the call has its own id, awaits this person and this install, the runner has a tool of that name and the call has not run here before, then hands the result to send. A result that could not be sent is sent again on a later update, without running the tool again.

    The runner is confined to the main thread: call run from it, and pass a scope that runs on it, such as a viewModelScope or rememberCoroutineScope().

    val runner = AIClientToolRunner(userId, AIClientIdentity.installId(context), listOf(LocationTool()), scope)
    runner.run(parts) { call, result -> backend.send(result, call, message) }