31 lines
944 B
Python
31 lines
944 B
Python
# filepath: f:\Dev\Rag\chat_bot_rag\app.py
|
|
|
|
import gradio as gr
|
|
from services.rag_service import initialize_rag_bot
|
|
from components.chatbot import process_query, reset_conversation, change_model, change_collection
|
|
from components.ui import build_interface, update_ui_language_elements
|
|
|
|
def main():
|
|
"""Main entry point for the chatbot application"""
|
|
# Initialize the RAG chatbot
|
|
initialize_rag_bot()
|
|
|
|
# Construire l'interface
|
|
interface = build_interface(
|
|
process_query_fn=process_query,
|
|
reset_conversation_fn=reset_conversation,
|
|
change_model_fn=change_model,
|
|
change_collection_fn=change_collection,
|
|
update_ui_language_fn=update_ui_language_elements # Ajout du paramètre manquant
|
|
)
|
|
|
|
# Lancer l'appli Gradio
|
|
interface.launch(
|
|
share=False,
|
|
inbrowser=True,
|
|
server_name="localhost",
|
|
server_port=7860
|
|
)
|
|
|
|
if __name__ == "__main__":
|
|
main() |