Skip to content
Snippets Groups Projects
Commit bc2d503f authored by leehuwuj's avatar leehuwuj
Browse files

raise error if there is no tools

parent b4f07672
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,6 @@ from typing import List
from llama_index.core.agent.workflow import AgentWorkflow
# from llama_index.core.agent import AgentRunner
from llama_index.core.settings import Settings
from llama_index.core.tools import BaseTool
......@@ -29,6 +28,9 @@ def get_engine(params=None, **kwargs):
configured_tools: List[BaseTool] = ToolFactory.from_env()
tools.extend(configured_tools)
if len(tools) == 0:
raise RuntimeError("Please provide at least one tool!")
return AgentWorkflow.from_tools_or_functions(
tools_or_functions=tools, # type: ignore
llm=Settings.llm,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment