Skip to main content
Glama
utils.cpython-313.pyc4.49 kB
� �#�hl��$�SSKJr SSKJr SSKJr SSKJr SSKJ r SSK J r SSK J r JrJrJr SSKr\"S S 9rS \S \ 4S jrSS \S\S\ \S\ \S\ \\/S4S \4 SjjrSS \S\S\ \S\ \S\S\ \\/S4S \4Sjjrg)�)� HumanMessage)�RunnableConfig)�user_goal_prompt)�create_react_agent)�MultiServerMCPClient��ChatGoogleGenerativeAI)�Optional�Tuple�Any�CallableN�d)�recursion_limit�google_api_key�returnc��[SUS9$)Nzgemini-2.5-flash)�modelrr)rs �TC:\Users\GLADWIN\Gladwin Coding\Github_Projects\mcp-learning-path-demo-main\utils.py�initialize_modelr s�� !� �%� ���youtube_pipedream_url�drive_pipedream_url�notion_pipedream_url�progress_callbackc���# �U(aU"S5 SUSS.0nU(aUSS.US'U(aU"S5 U(aUSS.US'U(aU"S5 U(aU"S 5 [U5nU(aU"S 5 UR5IS hv�N nU(aU"S 5 [U5n[X�5n U(aU"S 5 U $N:![an [ S[ U 535 eS n A ff=f7f)zO Set up the agent with YouTube (mandatory) and optional Drive or Notion tools. u"Setting up agent with tools... ✅�youtube�streamable_http)�url� transport�driveu%Added Google Drive integration... ✅�notionuAdded Notion integration... ✅uInitializing MCP client... ✅uGetting available tools... ✅NuCreating AI agent... ✅u9Setup complete! Starting to generate learning path... ✅z!Error in setup_agent_with_tools: )r� get_toolsrr� Exception�print�str) rrrrr� tools_config� mcp_client�tools�mcp_orch_model�agent�es r�setup_agent_with_toolsr,s���4� � �B� C� �,�.�� � � �*�.�%�L�� !�!�!�"I�J� �+�.�&�L�� "�!�!�"C�D� � �>� ?�)�,�7� � � �>� ?� �*�*�,�,�� � �8� 9�)�.�9��"�>�9�� � �Y� Z�� �-�� �� �1�#�a�&��:�;� ���s;�C9�BC�C �9C� C9� C� C6�C1�1C6�6C9� user_goalc��^^^^^^�UUUUUU4Sjn[R"5n[R"U5 URU"55UR 5 $!UR 5 f=f)z, Synchronous wrapper for running the agent. c��>># �[TT TTTS9IShv�N nST-S-[-nT(aT"S5 URS[US9/0[S9IShv�N nT(aT"S5 U$NYN![ an[ S [U535 eSnAff=f7f) N)rrrrrz User Goal: � z Generating your learning path...�messages)�content)�configz"Learning path generation complete!zError in _run: )r,r�ainvoker�cfgr#r$r%) r*�learning_path_prompt�resultr+rrrrr-rs ������r�_run�run_agent_sync.<locals>._run]s����� �0�-�&;�$7�%9�"3� ��E�$1�9�#<�t�#C�FV�#V� � �!�"D�E�!�=�=��l�3G�H�I�J��)���F� !�!�"F�G��M�/���� � �O�C��F�8�,� -� �� �sK�B�A3�A/�AA3�A1�A3�.B�/A3�1A3�3 B�=B�B�B)�asyncio�new_event_loop�set_event_loop�run_until_complete�close)rrrrr-rr8�loops`````` r�run_agent_syncr@RsS�����> � !� !� #�D� ���4� ���&�&�t�v�.� � � � ��� � � �s �A$�$A6)NNN)NN�N)�langchain_core.messagesr�langchain_core.runnablesr�promptr�langgraph.prebuiltr�langchain_mcp_adapters.clientr�langchain_google_genair �typingr r r r r:r5r%rr,�dictr@�rr�<module>rKs ��0�3�#�1�>�9�1�1���S�)���S��-C��*.�*.�9=� >��>��>�"�#��>�#�3�-� >�  ��#���� 5�6� >�  � >�F*.�*.��9=� /��/��/�"�#��/�#�3�-� /� � /�  ��#���� 5�6� /� �/r

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/GladwinTM/Learning-PathWay-Creator'

If you have feedback or need assistance with the MCP directory API, please join our Discord server