MCPcopy Index your code
hub / github.com/1Panel-dev/MaxKB / _run

Function _run

apps/application/flow/tools.py:777–798  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

775 # print(f"Initializing skills in temporary directory: {skills_dir}")
776
777 async def _run():
778 try:
779 async_gen = _yield_mcp_response(
780 chat_model,
781 system_prompt,
782 message_list,
783 mcp_servers,
784 mcp_output_enable,
785 tool_init_params,
786 source_id,
787 source_type,
788 temp_dir,
789 chat_id,
790 extra_tools,
791 )
792 async for chunk in async_gen:
793 result_queue.put(("data", chunk))
794 except Exception as e:
795 maxkb_logger.error(f"Exception: {e}", exc_info=True)
796 result_queue.put(("error", e))
797 finally:
798 result_queue.put(("done", None))
799
800 # 在全局循环中调度任务
801 asyncio.run_coroutine_threadsafe(_run(), loop)

Callers 1

mcp_response_generatorFunction · 0.85

Calls 3

_yield_mcp_responseFunction · 0.85
putMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected