File size: 1,166 Bytes
88d205f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
Language Selector Component

This module provides the UI component for selecting programming languages to analyze.
"""

import gradio as gr
import logging

logger = logging.getLogger(__name__)

# List of supported programming languages
SUPPORTED_LANGUAGES = [
    "Python", "JavaScript", "TypeScript", "Java", 
    "Go", "Rust", "C++", "C#", "PHP", "Ruby",
    "Swift", "Kotlin", "Scala", "R", "Shell"
]


def create_language_selector():
    """
    Create the language selector component.
    
    Returns:
        gr.CheckboxGroup: The language selector component.
    """
    with gr.Group():
        gr.Markdown("### 🔤 Languages (Optional)")
        
        language_selector = gr.CheckboxGroup(
            choices=SUPPORTED_LANGUAGES,
            label="Select languages to analyze",
            info="Leave empty to auto-detect languages",
            value=[],
        )
        
        gr.Markdown(
            "*Note: If no languages are selected, the agent will automatically detect languages in the repository.*",
            elem_classes=["small-text"]
        )
    
    return language_selector