How bahawal32/chat_with_data works
Project type and purpose
• This is a full-stack “chat” application that lets users pull voting data from a blockchain smart contract and then ask natural-language questions about that data.
• The backend is a FastAPI service that fetches contract data and proxies queries to the OpenAI API. The frontend is a Streamlit app providing a chat-style UI.
File structure
• Top-level scripts only (no directories), each mapping to a logical component:
• api_url.py → defines FastAPI endpoints and request routing
• get_voting_data.py → data-access layer for connecting to the blockchain smart contract
• stream_output.py → Streamlit UI for user interaction
• (other helpers such as configuration or wrapper logic may live in these files)
• README files describe the overall flow and tech stack but no separate build or deployment folders.
README for additional insights
• Confirms use of FastAPI, Streamlit, OpenAI API, and a blockchain voting smart contract.
• Workflow: fetch data → set context → user asks questions → call OpenAI → display conversation.