Following this instruction :
1. Strictly adhere to PEP-8 standards, ensuring code is clean, well-structured, and follows Python's style guide for readability.
2. Use appropriate modules like `typing` for type hints, ensuring code clarity, maintainability, and leveraging Python's standard libraries effectively.
3. Focus on time, space, robustness, scalability; write optimized, efficient code that can handle large datasets and scale seamlessly.
4. Implement comprehensive error handling, catching exceptions gracefully, providing meaningful error messages, and ensuring code robustness under unexpected conditions.
5. Ensure the developer agent writes advanced, maintainable Python code, balancing performance and readability while adhering to best practices.



TASK : response its view not looking professionally , format not proerly , below logic , professionality view is absent, think like chatbox interface chatgpt look
text automatically fixing in the format box system  is missing , response and relevent content,

from main import load_or_create_vector_store,gradio_interface


def main():
    """
    Main function to load vector store and launch Gradio interface.
    """
    # Define paths
    txt_output_dir = Path(r"E:\LLMS\Fine-tuning\output1")  # Update with your directory
    index_path = Path("faiss_index")
    metadata_path = Path("faiss_index_metadata")

    # Load or create vector store
    global vector_store
    vector_store = load_or_create_vector_store(
        txt_output_dir=txt_output_dir,
        index_path=index_path,
        metadata_path=metadata_path,
    )

    # Define custom CSS
    css = """
    /* Custom CSS styles */
    #title {
        font-size: 32px;
        font-weight: bold;
        text-align: center;
        color: #333;
        margin-bottom: 20px;
    }
    #description {
        font-size: 18px;
        text-align: center;
        color: #666;
        margin-bottom: 30px;
    }
    #query-textbox {
        border: 2px solid #333;
        padding: 10px;
        font-size: 18px;
        color: #333;
        width: 100%;
    }
    #response-box {
        border: 2px solid #007ACC;
        padding: 15px;
        font-size: 16px;
        background-color: #f0f8ff;
        color: #333;
        width: 100%;
        height: 200px;
    }
    #results-box {
        border: 2px solid #28a745;
        padding: 15px;
        font-size: 16px;
        background-color: #e9ffe9;
        color: #333;
        width: 100%;
        height: 400px;
        overflow-y: auto;
    }
    #submit-button {
        background-color: #007ACC;
        color: #fff;
        font-size: 18px;
        padding: 10px 20px;
        width: 100%;
    }
    .result-item {
        margin-bottom: 20px;
    }
    .result-item h4 {
        margin: 0 0 10px;
        color: #007ACC;
    }
    .content, .metadata {
        margin-bottom: 10px;
    }
    """

    # Build Gradio interface
    with gr.Blocks(css=css) as demo:
        gr.HTML("<div id='title'>Document Search and LLM Query System</div>")
        gr.HTML(
            "<div id='description'>Enter your query below to receive a response, relevant content, and metadata.</div>"
        )

        with gr.Row():
            user_query = gr.Textbox(
                lines=2,
                placeholder="Enter your query here...",
                elem_id="query-textbox",
                label="Your Query",
            )
        submit_btn = gr.Button("Submit", elem_id="submit-button")
        with gr.Row():
            response = gr.HTML(elem_id="response-box")
        with gr.Row():
            results = gr.HTML(elem_id="results-box")

        submit_btn.click(
            fn=gradio_interface, inputs=user_query, outputs=[response, results]
        )

    # Launch Gradio app
    demo.launch()


if __name__ == "__main__":
    main()