File size: 812 Bytes
134a706
eec008c
c979284
134a706
c979284
134a706
 
 
 
 
 
eec008c
6d6f152
eec008c
c979284
134a706
eec008c
c979284
134a706
eec008c
134a706
eec008c
 
134a706
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import streamlit as st
from whale_core import parser, agents

st.set_page_config(page_title="HuggingWhale.AI", page_icon="πŸ‹")

st.title("πŸ‹ HuggingWhale.AI")
st.write("Drop your chaos here and we'll pretend to make sense of it...")

uploaded_file = st.file_uploader("πŸ“„ Upload your PDF or Text file", type=["pdf", "txt"])

if uploaded_file:
    try:
        doc = parser.parse_file(uploaded_file)
        chunks = parser.chunk_and_embed(doc)

        agent_cfgs = agents.load_agents("config.yaml")
        responses = agents.run_agents_on_text(agent_cfgs, doc)

        st.subheader("🧠 Agent Responses")
        for name, reply in responses.items():
            st.markdown(f"**πŸ€– {name} says:**\n\n{reply}")

    except Exception as e:
        st.error(f"πŸ’₯ Oops! Something went wrong:\n{str(e)}")