Content-Length: 292883 | pFad | http://github.com/jackwotherspoon/adk-human-in-the-loop

34 GitHub - jackwotherspoon/adk-human-in-the-loop: An example of an ADK agent performing human-in-the-loop.
Skip to content

jackwotherspoon/adk-human-in-the-loop

Repository files navigation

🤖🔁👱 ADK Human-in-the-Loop Example

Python Framework License

This is a simple example of using Agent Development Kit (ADK) to create a human-in-the-loop workflow.

In this example we will use a human-in-the-loop workflow to send an expense request for manager approval. The agent then waits until the manager approves or rejects the request before proceeding.

Running the Example

We will use a FastAPI server to handle the expense requests and a Streamlit app to display the pending requests as a manager approval dashboard.

Start the FastAPI server

The FastAPI server provides basic CRUD operations for the expense requests and stores them in memory in a dictionary.

uv run server.py

The server is now running on localhost:9000 and provides a REST API for the expense requests.

Start the Streamlit app

The Streamlit app will display all pending expense requests and allow the manager to approve or reject them.

uv run streamlit run client.py

The Streamlit app is now running on localhost:8501 and displays a manager approval dashboard.

Streamlit App

Start the ADK agent

uv run adk web

Navigate to localhost:8000 in your browser to access the ADK web interface.

Go ahead and type something like Amount 500, reason "team dinner".

You should see the agent call the prepare_approval tool which creates a new expense request and posts it to the FastAPI server.

The agent then waits for the manager to approve or reject the request. This is done by calling the external_approval_tool tool which polls the FastAPI server for the request status every 30 seconds until the request is no longer pending (approved or rejected).

To approve or reject the request, head to the Streamlit app at localhost:8501 in your browser and click the Approve or Reject button for the given expense ID.

Pending Expense

Hit Reject or Approve and wait for the agent to poll the FastAPI server for the request status.

Once it does so it should respond accordingly based on the human-in-the-loop decision!

ADK Web Interface

About

An example of an ADK agent performing human-in-the-loop.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/jackwotherspoon/adk-human-in-the-loop

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy