TestDeploy / app.py
wap1ft
hf changes
2082263
Raw
History Blame Contribute Delete
1.14 kB
import streamlit as st
from agent_engine import run_agent
from llm_client import DEFAULT_MODEL, DEFAULT_PROVIDER, call_llm # this file changes per tab below
st.set_page_config(page_title="Agentic AI Lab", page_icon="πŸ€–")
st.title("πŸ€– Agentic AI Demo")
hf_token = st.text_input("Hugging Face token", type="password")
model = st.text_input("Model", value=DEFAULT_MODEL)
providers = ["auto", "novita", "together", "fireworks-ai", "zai-org", "baseten", "deepinfra", "hf-inference"]
provider = st.selectbox("Provider", providers, index=providers.index(DEFAULT_PROVIDER))
query = st.text_input("Ask the agent (try: 'what is 45*12, then word-count the answer as text')")
if st.button("Run agent") and query:
box = st.container()
def log(step, thought, action, action_input):
box.markdown(f"**Step {step}** β€” _{thought}_ \n`{action}({action_input})`")
try:
answer, _ = run_agent(
query,
lambda prompt: call_llm(prompt, token=hf_token, model=model, provider=provider),
log=log,
)
st.success(answer)
except RuntimeError as error:
st.error(str(error))