A generic Streamlit UI for testing generative AI agents built using Agents for Amazon Bedrock. For more information, refer to the blog post Developing a Generic Streamlit UI to Test Amazon Bedrock Agents.
-
Run the following
pip
command to install the dependencies:pip install -r requirements.txt
-
Set the following environment variables either directly or using a
.env
file (use.env.template
as a starting point):BEDROCK_AGENT_ID
- The ID of the agent.BEDROCK_AGENT_ALIAS_ID
- The ID of the agent alias. The defaultTSTALIASID
will be used if it is not set.- The AWS environment variables that provides the credentials to your account. The principal must have the necessary permissions to invoke the Bedrock agent.
-
(Optional) Set the following environment variables similarly to customize the UI:
BEDROCK_AGENT_TEST_UI_TITLE
- The page title. The defaultAgents for Amazon Bedrock Test UI
will used if it is not set.BEDROCK_AGENT_TEST_UI_ICON
- The favicon, such as:bar_chart:
. The default Streamlit icon will be used if it is not set.
-
(Optional) Set the
LOG_LEVEL
environment variable for additional logging using a standard format. If more advanced configuration is needed, copylogging.yaml.template
andlogging.yaml
and configure it as appropriate. -
Run the following command to start the Streamlit app:
streamlit run app.py --server.port=8080 --server.address=localhost