Team Ai
Apppublic

ankitpatil3003/Basic-AI-Chatbot-using-Langgraph

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
1likes
main.cpython-312.pyc18 linesDownload Raw Back to __pycache__
1�

2�P�g���J�ddlZddlZddlmZddlmZddlmZddl	m3Z4d�Zy)�N)�LoadStreamlitUI)�GroqLLM)�GraphBuilder)�DisplayResultStreamlitc���t�}|j�}|stjd�ytjj5rtjj}ntjd�}|r�	t|��}|j�}|stjd�y|jd�}|stjd�yt|�}	|j|�}t|||�j�yy#t$r"}tjd|���Yd}~yd}~wwxYw#t$r}t!d	|����d}~wwxYw)6a,7    Loads and runs the LangGraph AgenticAI application with Streamlit UI.8    This function initializes the UI, handles user input, configures the LLM model,9    sets up the graph based on the selected use case, and displays the output while 10    implementing exception handling for robustness.11    z-Error: Failed to load user input from the UI.NzEnter your message:)�user_controls_inputz*Error: LLM model could not be initialized.�selected_usecasezError: No use case selected.zError: Graph setup failed - z Error Occurred with Exception : )r�load_streamlit_ui�st�error�
session_state�IsFetchButtonClicked�	timeframe�12chat_inputr�
get_llm_model�getr�setup_graphr�display_result_on_ui�	Exception�13ValueError)	�ui�14user_input�user_message�obj_llm_config�model�usecase�
graph_builder�graph�es	         �<D:\Projects\langgraph Project\src\langgraphagenticai\main.py�load_langgraph_agenticai_appr!	s@��15�	�B��%�%�'�J��16���@�A��17���,�,��'�'�1�1���}�}�%:�;���
J�!(�Z�!H��&�4�4�6����H�H�I�J��%�.�.�);�<����H�H�;�<��+�5�1�
��)�5�5�g�>�E�*�7�5��F�[�[�]�+��,!���H�H�;�A�3�?�@�����18�
J�!�$D�Q�C�"H�I�I��
J�sH�3E�4(E�E�),D�	E� D=�8E�=E�E�	E!�E�E!)�	streamlitr�json�,src.langgraphagenticai.ui.streamlitui.loaduir�#src.langgraphagenticai.LLMS.groqllmr�*src.langgraphagenticai.graph.graph_builderr�4src.langgraphagenticai.ui.streamlitui.display_resultrr!��r �<module>r*s����H�7�C�W�2Jr)