一键导入
hl-build-agent-app
Build a complete agent app with LLM reasoning + tool execution on Hailo-10H.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Build a complete agent app with LLM reasoning + tool execution on Hailo-10H.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Build an AI agent application with LLM tool calling for Hailo-10H.
Build an LLM chat application for Hailo-10H.
Build a GStreamer pipeline application for Hailo accelerators.
Build a standalone HailoRT inference application.
Build a Vision-Language Model application for Hailo-10H.
Build a voice assistant with Whisper STT and Piper TTS for Hailo-10H.
| name | hl-build-agent-app |
| description | Build a complete agent app with LLM reasoning + tool execution on Hailo-10H. |
Build a complete agent app with LLM reasoning + tool execution on Hailo-10H.
Study hailo_apps/python/gen_ai_apps/agent_tools_example/ — the canonical agent app:
agent_tools_example.py — Main agent looptools/ — Tool implementations (subclass BaseTool)config.yaml — Tool configurationAlso study the agent utilities:
gen_ai_utils/llm_utils/tool_parsing.py — Parse LLM output for tool callsgen_ai_utils/llm_utils/tool_execution.py — BaseTool, ToolResultgen_ai_utils/llm_utils/tool_discovery.py — Auto-discover tools from directoryCreate the app directory:
hailo_apps/python/<type>/<app_name>/
├── app.yaml # App manifest (type: gen_ai)
├── run.sh # Launch wrapper
├── __init__.py
├── <app_name>.py # Main agent loop
├── tools/
│ ├── __init__.py
│ ├── config.yaml # Tool metadata
│ ├── my_tool_1.py # Implements BaseTool
│ └── my_tool_2.py # Implements BaseTool
└── README.md # Usage documentation (REQUIRED — never skip)
Create app.yaml with type: gen_ai and run.sh wrapper.
Do NOT register in defines.py or resources_config.yaml.
Each tool implements the BaseTool interface:
from hailo_apps.python.gen_ai_apps.agent_tools_example.tools.base import BaseTool, ToolResult
class WeatherTool(BaseTool):
@property
def name(self) -> str:
return "get_weather"
@property
def description(self) -> str:
return "Get current weather for a city"
@property
def schema(self) -> dict:
return {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "City name (e.g., 'Tel Aviv')"
}
},
"required": ["city"]
}
def run(self, **kwargs) -> ToolResult:
city = kwargs["city"]
# Actual implementation here
return ToolResult(
success=True,
data={"city": city, "temperature": 25, "condition": "Sunny"}
)
# tools/config.yaml
version: "1.0"
tool_name: "my_agent"
persona: "You are a helpful assistant with access to tools."
capabilities:
- "Look up weather information"
- "Perform calculations"
few_shot_examples:
- user: "What's the weather in Tel Aviv?"
assistant: "I'll check the weather for you."
tool_call: '{"name": "get_weather", "arguments": {"city": "Tel Aviv"}}'
import signal
import argparse
from hailo_apps.python.core.common.hailo_logger import get_logger
logger = get_logger(__name__)
APP_NAME = "my_agent_app"
def main():
parser = argparse.ArgumentParser(description="My Agent App")
parser.add_argument("--debug", action="store_true", help="Show tool calls")
parser.add_argument("--multi-turn", action="store_true", help="Enable multi-turn context")
parser.add_argument("--voice", action="store_true", help="Enable voice input")
parser.add_argument("--no-tts", action="store_true", help="Disable TTS")
args = parser.parse_args()
signal.signal(signal.SIGINT, lambda s, f: sys.exit(0))
# Initialize agent (uses AgentApp or custom loop)
# Tool discovery from tools/ directory
# Main loop: user input → LLM reasoning → tool parsing → execution → response
if __name__ == "__main__":
main()
python3 .github/scripts/validate_app.py hailo_apps/python/gen_ai_apps/my_agent_app --smoke-test
BaseTool with name, description, schema, run()ToolResult(success=bool, data=dict)tools/ directorypersona, capabilities, few_shot_examplesschema property returns valid JSON Schematool_parsing utilities to extract tool calls from LLM outputcontext_manager for multi-turn, StateManager for persistenceget_logger(__name__)User Input
│
▼
LLM generates response
│
├── Contains tool call? → Parse → Execute tool → Feed result back to LLM
│ │
│ ▼
│ LLM generates final response
│
└── No tool call? → Direct response to user