Skip to content

Update README and add demo videos to the WebApp#154

Merged
lfnothias merged 2 commits intodevfrom
dev_yousouf_v2
Apr 17, 2025
Merged

Update README and add demo videos to the WebApp#154
lfnothias merged 2 commits intodevfrom
dev_yousouf_v2

Conversation

@YoucTagh
Copy link
Contributor

@YoucTagh YoucTagh commented Apr 10, 2025

PR Type

enhancement, documentation


Description

  • Added demo videos to the Streamlit web app.

  • Refactored code in main.py for improved readability.

  • Introduced IntRange class for argument validation.

  • Updated README with correct conda activation command.


Changes walkthrough 📝

Relevant files
Enhancement
main.py
Refactor and enhance main.py for readability                         

app/core/main.py

  • Refactored imports and removed unused ones.
  • Improved readability by adding spacing and comments.
  • Introduced IntRange class for argument validation.
  • +22/-47 
    utils.py
    Add IntRange class and improve readability                             

    app/core/utils.py

  • Added IntRange class for range validation.
  • Improved function spacing for readability.
  • +24/-0   
    streamlit_app.py
    Add demo videos to Streamlit app                                                 

    streamlit_webapp/streamlit_app.py

  • Added function to include demo videos in the app.
  • Updated UI to display videos based on conditions.
  • +13/-1   
    Formatting
    questions.py
    Minor formatting update in questions.py                                   

    app/core/questions.py

    • Added a comma to the last item in the list.
    +2/-2     
    Documentation
    README.md
    Update README with correct conda activation                           

    README.md

    • Corrected conda environment activation command.
    +2/-2     

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @qodo-code-review
    Copy link

    qodo-code-review bot commented Apr 10, 2025

    PR Reviewer Guide 🔍

    (Review updated until commit 1db9972)

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Docstring Format

    Several key functions (such as get_api_key, create_litellm_model, llm_creation, and langsmith_setup) include docstrings. Please ensure they strictly adhere to the Google Docstring format with clear sections for Args, Returns, and Raises where applicable.

    def get_api_key(provider: str) -> Optional[str]:
        """
        Get API key for specified provider from environment variables.
    
        Args:
            provider: Provider name matching a key in API_KEY_MAPPING
    
        Returns:
            API key if found, None otherwise
        """
        env_var = API_KEY_MAPPING.get(provider)
        return os.getenv(env_var) if env_var else None
    
    
    def create_litellm_model(config: configparser.SectionProxy) -> ChatLiteLLM:
        """
    Missing Docstring

    The new function add_videos_to_content lacks a Google style docstring. Consider adding one to describe its purpose, arguments (if any), and expected behavior.

    def add_videos_to_content():
        st.markdown("---")
        st.subheader("Illustrative videos")
        st.markdown("Here are some illustrative videos to help you understand how to use MetaboT.")
        st.video("https://youtu.be/R6OiFt9ryxY")
        st.markdown("---")
        st.video("https://youtu.be/LpywYlHBWpw")
    Missing Class Documentation

    The newly added IntRange class does not include a Google style docstring. Please add proper documentation to detail its purpose and usage.

    class IntRange:
        def __init__(self, start, end):
            self.start = start
            self.end = end
            self.range = range(start, end + 1)
    
        def __contains__(self, item):
            return item in self.range
    
        def __iter__(self):
            # for help display
            return iter([f"[{self.start}, {self.end}]"])
    
        def __str__(self):
            return f"[{self.start}, {self.end}]"
    
        def __repr__(self):
            return self.__str__()

    @github-actions
    Copy link
    Contributor

    Persistent review updated to latest commit 1db9972

    @github-actions
    Copy link
    Contributor

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    1 similar comment
    @qodo-code-review
    Copy link

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    @lfnothias lfnothias merged commit 1c57e2f into dev Apr 17, 2025
    1 check passed
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    2 participants