Skip to content

manideepBotsaa/streamlit_application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

32 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

streamlit_application

Open Source

AI Chatbot Documentation

Overview

This project is a Streamlit-based web application that implements a personal gym chatbot. It uses the Ollama API for local AI processing and provides a user-friendly interface for interacting with different language models.

Thanks Banner Typing SVG

πŸ“Š Project Insights

🌟 Stars 🍴 Forks πŸ› Issues πŸ”” Open PRs πŸ”• Closed PRs πŸ› οΈ Languages πŸ‘₯ Contributors
Stars Forks Issues Open PRs Closed PRs Languages Count Contributors Count

Features

  • Dark-themed user interface with custom CSS styling
  • Configurable model selection (llama2, mistral, codellama)
  • Adjustable temperature setting for AI responses
  • Chat history persistence using Streamlit session state
  • Real-time chat interface with user and assistant messages
  • Clear chat functionality
  • Error handling for API requests

GSSoC Logo

🌟 Exciting News...

πŸš€ This project is now an official part of GirlScript Summer of Code – GSSoC'25! πŸ’ƒπŸŽ‰πŸ’» We're thrilled to welcome contributors from all over India and beyond to collaborate, build, and grow streamlit application! Let’s make learning and career development smarter – together! πŸŒŸπŸ‘¨β€πŸ’»πŸ‘©β€πŸ’»

πŸ‘©β€πŸ’» GSSoC is one of India’s largest 3-month-long open-source programs that encourages developers of all levels to contribute to real-world projects 🌍 while learning, collaborating, and growing together. 🌱

🌈 With mentorship, community support, and collaborative coding, it's the perfect platform for developers to:

  • ✨ Improve their skills
  • 🀝 Contribute to impactful projects
  • πŸ† Get recognized for their work
  • πŸ“œ Receive certificates and swag!

πŸŽ‰ I can’t wait to welcome new contributors from GSSoC 2025 to this streamlit application project family! Let's build, learn, and grow together β€” one commit at a time. πŸ”₯πŸ‘¨β€πŸ’»πŸ‘©β€πŸ’»

Prerequisites

  • Python 3.8+
  • Streamlit
  • Requests library
  • Ollama server running locally on port 11434

-----------------------------------------------------

Installation

  1. Install required Python packages:
pip install streamlit requests
  1. Ensure Ollama is installed and running locally:
  • Follow Ollama's official documentation for installation
  • Start the Ollama server: ollama serve

-----------------------------------------------------

Project Structure

project_directory/
β”‚
β”œβ”€β”€ app.py           # Main application code
β”œβ”€β”€ README.md        # This documentation file

-----------------------------------------------------

Usage

  1. Run the Streamlit app:
streamlit run app.py
  1. Access the application through your web browser (typically at http://localhost:8501)

  2. Configure settings in the sidebar:

  • Select desired model
  • Adjust temperature slider
  • View application information
  1. Interact with the chatbot:
  • Enter messages in the text input field
  • Click "Send" to get AI responses
  • Use "Clear Chat" to reset the conversation

-----------------------------------------------------

Code Explanation

Imports

  • streamlit: For creating the web interface
  • requests: For making API calls to Ollama
  • json: For handling JSON data

Page Configuration

st.set_page_config(
    page_title="AI Chatbot",
    page_icon="πŸ€–",
    layout="wide"
)

Sets up the Streamlit page with a title, icon, and wide layout.

CSS Styling Custom CSS is applied using st.markdown with unsafe_allow_html=True to create a dark theme and style various UI components.

Session State

if 'messages' not in st.session_state:
    st.session_state.messages = []

Initializes chat history storage using Streamlit's session state.

Sidebar Configuration

with st.sidebar:
    st.title("βš™οΈ Configuration")
    model = st.selectbox(...)
    temperature = st.slider(...)

Creates a sidebar for model selection and temperature adjustment.

Main Interface

  • Displays the chat history in a container
  • Shows user and assistant messages with proper formatting
  • Uses markdown for styling

Ollama Integration

def query_ollama(prompt, model_name, temp):
    response = requests.post("http://localhost:11434/api/generate", ...)

Handles API calls to the local Ollama server for generating responses.

Chat Functionality

  • Text input for user messages
  • Send button to trigger AI response
  • Clear chat button to reset conversation
  • Spinner during API processing

-----------------------------------------------------

Error Handling

  • Checks for valid user input
  • Handles API request errors
  • Displays warning messages when appropriate

-----------------------------------------------------

Limitations

  • Requires local Ollama server
  • Limited to supported models (llama2, mistral, codellama)
  • No persistent storage for chat history
  • Basic error handling for API failures

-----------------------------------------------------

Future Improvements

  • Add persistent storage for chat history
  • Implement message streaming
  • Add support for more models
  • Enhance error handling
  • Add conversation export functionality

-----------------------------------------------------

Troubleshooting

  • Ensure Ollama server is running on port 11434
  • Verify model availability in Ollama
  • Check internet connection for package installation
  • Monitor Streamlit logs for errors

πŸ“œ Code of Conduct

Please refer to the Code of Conduct for details on contributing guidelines and community standards.

πŸ€πŸ‘€ Contribution Guidelines

We love our contributors! If you'd like to help, please check out our CONTRIBUTE.md file for guidelines.

Thank you once again to all our contributors who has contributed to streamlit application! Your efforts are truly appreciated. πŸ’–πŸ‘

Contributors

Contributors

See the full list of contributors and their contributions on the GitHub Contributors Graph.

Show some Red Heart by starring this awesome repository!

πŸ’‘ Suggestions & Feedback

Feel free to open issues or discussions if you have any feedback, feature suggestions, or want to collaborate!

πŸ™Œ Support & Star

If you find this project helpful, please give it a star ⭐ to support more such educational initiatives!

πŸ“„ License

This project is licensed under the MIT License - see the License file for details.

⭐ Stargazers

🍴 Forkers

Forkers

πŸ§‘β€πŸ’»Project Admin:

Manideep Botsa
Manideep Botsa

πŸ‘¨β€πŸ« Mentors – streamlit application (GSSoC'25)

Role Name GitHub Profile LinkedIn Profile
Mentor 1 Aayush Kumar Gupta AayushKGupta12 aayush-kumar-gupta

Glowing Star Give us a Star and let's make magic! Glowing Star

Mirror Ball

πŸ‘¨β€πŸ’» Built with ❀️ by streamlit application Team

❀️ Manideep Botsa and Contributors ❀️ open an issue

Ready to show off your coding achievements? Get started with streamlit application today! πŸš€

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 8

Languages