{"id":587,"date":"2025-01-11T15:16:14","date_gmt":"2025-01-11T15:16:14","guid":{"rendered":"https:\/\/smolagents.org\/?post_type=docs&#038;p=587"},"modified":"2025-01-11T15:16:16","modified_gmt":"2025-01-11T15:16:16","password":"","slug":"agents-guided-tour","status":"publish","type":"docs","link":"https:\/\/smolagents.org\/ja\/docs\/agents-guided-tour\/","title":{"rendered":"\u4ee3\u7406\u5e97 - \u30ac\u30a4\u30c9\u4ed8\u304d\u30c4\u30a2\u30fc"},"content":{"rendered":"<p>\u3053\u306e\u30ac\u30a4\u30c9\u4ed8\u304d\u8a2a\u554f\u3067\u306f\u3001\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306e\u69cb\u7bc9\u65b9\u6cd5\u3001\u5b9f\u884c\u65b9\u6cd5\u3001\u305d\u3057\u3066\u3042\u306a\u305f\u306e\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u306b\u3088\u308a\u826f\u304f\u6a5f\u80fd\u3059\u308b\u3088\u3046\u306b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u65b9\u6cd5\u3092\u5b66\u3073\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/huggingface.co\/docs\/smolagents\/guided_tour#building-your-agent\" target=\"_blank\" rel=\"noopener\"><\/a>\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306e\u69cb\u7bc9<\/h3>\n\n\n\n<p>\u6700\u5c0f\u9650\u306e\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3092\u521d\u671f\u5316\u3059\u308b\u306b\u306f\u3001\u5c11\u306a\u304f\u3068\u3082\u4ee5\u4e0b\u306e2\u3064\u306e\u5f15\u6570\u304c\u5fc5\u8981\u3067\u3059\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\u30e2\u30c7\u30eb<\/code>\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306f\u5358\u7d14\u306aLLM\u3068\u306f\u7570\u306a\u308a\u3001LLM\u3092\u30a8\u30f3\u30b8\u30f3\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u30b7\u30b9\u30c6\u30e0\u3067\u3059\u3002\u3053\u308c\u3089\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u3044\u305a\u308c\u304b\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff1a\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/huggingface.co\/docs\/smolagents\/v1.2.2\/en\/reference\/agents#smolagents.TransformersModel\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">\u30c8\u30e9\u30f3\u30b9\u30d5\u30a9\u30fc\u30de\u30fc\u30e2\u30c7\u30eb<\/a>\u00a0\u306f\u3001\u3042\u3089\u304b\u3058\u3081\u521d\u671f\u5316\u3055\u308c\u305f\u00a0<code>\u5909\u5727\u5668<\/code>\u00a0\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u3092\u4f7f\u7528\u3057\u3066\u3001\u30ed\u30fc\u30ab\u30eb\u30de\u30b7\u30f3\u3067\u63a8\u8ad6\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002\u00a0<code>\u5909\u5727\u5668<\/code>.<\/li>\n\n\n\n<li><a href=\"https:\/\/huggingface.co\/docs\/smolagents\/v1.2.2\/en\/reference\/agents#smolagents.HfApiModel\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">HfApiModel<\/a>\u00a0\u3092\u6d3b\u7528\u3057\u3066\u3044\u308b\u3002\u00a0<code>huggingface_hub.InferenceClient<\/code>\u00a0\u30dc\u30f3\u30cd\u30c3\u30c8\u306e\u4e0b\u3002<\/li>\n\n\n\n<li><a href=\"https:\/\/huggingface.co\/docs\/smolagents\/v1.2.2\/en\/reference\/agents#smolagents.LiteLLMModel\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">LiteLLMM\u30e2\u30c7\u30eb<\/a>\u00a0\u3092\u4ecb\u3057\u3066100\u4ee5\u4e0a\u306e\u7570\u306a\u308b\u30e2\u30c7\u30eb\u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u00a0<a href=\"https:\/\/docs.litellm.ai\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">LiteLLM<\/a>!<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><code>\u7528\u5177<\/code>\u306e\u30ea\u30b9\u30c8\u00a0<code>\u30c4\u30fc\u30eb<\/code>\u00a0\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u304c\u30bf\u30b9\u30af\u3092\u89e3\u6c7a\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3067\u304d\u308b\u3082\u306e\u3002\u7a7a\u306e\u30ea\u30b9\u30c8\u3067\u3082\u304b\u307e\u3044\u307e\u305b\u3093\u3002\u307e\u305f\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30c4\u30fc\u30eb\u30dc\u30c3\u30af\u30b9\u3092\u00a0<code>\u7528\u5177<\/code>\u00a0\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u5f15\u6570\u00a0<code>add_base_tools=True<\/code>.<\/li>\n<\/ul>\n\n\n\n<p>\u3053\u306e2\u3064\u306e\u5f15\u6570\u304c\u63c3\u3048\u3070\u00a0<code>\u7528\u5177<\/code>\u00a0\u305d\u3057\u3066\u00a0<code>\u30e2\u30c7\u30eb<\/code>\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3092\u4f5c\u6210\u3057\u3001\u305d\u308c\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u597d\u304d\u306aLLM\u3092\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u00a0<a href=\"https:\/\/huggingface.co\/docs\/api-inference\/en\/index\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">\u30cf\u30ae\u30f3\u30b0\u30fb\u30d5\u30a7\u30a4\u30b9API<\/a>,\u00a0<a href=\"https:\/\/github.com\/huggingface\/transformers\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">\u5909\u5727\u5668<\/a>,\u00a0<a href=\"https:\/\/ollama.com\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">\u30aa\u30e9\u30de<\/a>\u3042\u308b\u3044\u306f\u00a0<a href=\"https:\/\/www.litellm.ai\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">LiteLLM<\/a>.<\/p>\n\n\n\n<p>\u30cf\u30ae\u30f3\u30b0\u30fb\u30d5\u30a7\u30a4\u30b9API<\/p>\n\n\n\n<p>\u30ed\u30fc\u30ab\u30eb\u30fb\u30c8\u30e9\u30f3\u30b9\u30fb\u30e2\u30c7\u30eb<\/p>\n\n\n\n<p>OpenAI\u307e\u305f\u306fAnthropic API<\/p>\n\n\n\n<p>\u30aa\u30fc\u30e9\u30de<\/p>\n\n\n\n<p>Hugging Face API\u306f\u30c8\u30fc\u30af\u30f3\u306a\u3057\u3067\u7121\u6599\u3067\u5229\u7528\u3067\u304d\u308b\u304c\u3001\u305d\u306e\u5834\u5408\u306f\u30ec\u30fc\u30c8\u5236\u9650\u304c\u3042\u308b\u3002<\/p>\n\n\n\n<p>PRO\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u30b2\u30fc\u30c6\u30a3\u30f3\u30b0\u3055\u308c\u305f\u30e2\u30c7\u30eb\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u308a\u3001\u30ec\u30fc\u30c8\u306e\u4e0a\u9650\u3092\u4e0a\u3052\u305f\u308a\u3059\u308b\u306b\u306f\u3001\u74b0\u5883\u5909\u6570&nbsp;<code>HF_TOKEN<\/code>&nbsp;\u307e\u305f\u306f\u30d1\u30b9&nbsp;<code>\u30c8\u30fc\u30af\u30f3<\/code>&nbsp;\u5909\u6570\u306e\u521d\u671f\u5316\u6642\u306b&nbsp;<code>HfApiModel<\/code>.<\/p>\n\n\n\n<p>\u30b3\u30d4\u30fc<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from smolagents import CodeAgent, HfApiModel\n\nmodel_id = \"meta-llama\/Llama-3.3-70B-Instruct\"\n\nmodel = HfApiModel(model_id=model_id, token=\"\")\nagent = CodeAgent(tools=[], model=model, add_base_tools=True)\n\nagent.run(\n    \"\u30d5\u30a3\u30dc\u30ca\u30c3\u30c1\u6570\u5217\u306e118\u756a\u76ee\u306e\u6570\u3092\u6559\u3048\u3066\u3082\u3089\u3048\u307e\u3059\u304b\uff1f\n)<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><a href=\"https:\/\/huggingface.co\/docs\/smolagents\/guided_tour#codeagent-and-toolcallingagent\" target=\"_blank\" rel=\"noopener\"><\/a>CodeAgent\u3068ToolCallingAgent<\/h4>\n\n\n\n<p>\u306b\u3064\u3044\u3066\u00a0<a href=\"https:\/\/huggingface.co\/docs\/smolagents\/v1.2.2\/en\/reference\/agents#smolagents.CodeAgent\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">\u30b3\u30fc\u30c9\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8<\/a>\u00a0\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3067\u3059\u3002\u3053\u308c\u306f\u5404\u30b9\u30c6\u30c3\u30d7\u3067python\u30b3\u30fc\u30c9\u30b9\u30cb\u30da\u30c3\u30c8\u3092\u66f8\u3044\u3066\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u3001\u5b9f\u884c\u306f\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3067\u884c\u308f\u308c\u307e\u3059\u3002\u547c\u3073\u51fa\u305b\u308b\u95a2\u6570\u306f\u3001\u3042\u306a\u305f\u304c\u63d0\u4f9b\u3057\u305f\u30c4\u30fc\u30eb\uff08\u7279\u306bHugging Face\u306b\u3088\u308b\u30c4\u30fc\u30eb\u3060\u3051\u306a\u3089\uff09\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5b9a\u7fa9\u6e08\u307f\u306e\u5b89\u5168\u306a\u95a2\u6570\u306e\u30bb\u30c3\u30c8\u3060\u3051\u306a\u306e\u3067\u3001\u3053\u308c\u306f\u5b89\u5168\u306a\u306f\u305a\u3060\u3002&nbsp;<code>\u30d7\u30ea\u30f3\u30c8<\/code>&nbsp;\u307e\u305f\u306f&nbsp;<code>\u6570\u5b66<\/code>&nbsp;\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u5b9f\u884c\u3067\u304d\u308b\u3053\u3068\u306f\u9650\u3089\u308c\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p>Python\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u3082\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u30bb\u30fc\u30d5\u30ea\u30b9\u30c8\u4ee5\u5916\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\u3092\u8a31\u53ef\u3057\u306a\u3044\u306e\u3067\u3001\u6700\u3082\u660e\u767d\u306a\u653b\u6483\u306f\u3059\u3079\u3066\u554f\u984c\u306b\u306a\u3089\u306a\u3044\u306f\u305a\u3067\u3059\u3002\u5f15\u6570\u306b\u6587\u5b57\u5217\u306e\u30ea\u30b9\u30c8\u3068\u3057\u3066\u8a8d\u53ef\u3055\u308c\u305f\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u6e21\u3059\u3053\u3068\u3067\u3001\u8ffd\u52a0\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\u3092\u8a8d\u53ef\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u00a0<code>\u8ffd\u52a0\u8a8d\u53ef\u8f38\u5165<\/code>\u00a0\u521d\u671f\u5316\u6642\u306b\u00a0<a href=\"https:\/\/huggingface.co\/docs\/smolagents\/v1.2.2\/en\/reference\/agents#smolagents.CodeAgent\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">\u30b3\u30fc\u30c9\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8<\/a>:<\/p>\n\n\n\n<p>\u30b3\u30d4\u30fc<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">model = HfApiModel()\nagent = CodeAgent(tools=[], model=model, additional_authorized_imports=['requests', 'bs4'])\nagent.run(\"URL'https:\/\/huggingface.co\/blog'\u306b\u3042\u308b\u30da\u30fc\u30b8\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u53d6\u5f97\u3057\u3066\u3082\u3089\u3048\u307e\u3059\u304b\uff1f\")<\/pre>\n\n\n\n<p>LLM\u306f\u4efb\u610f\u306e\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3057\u3001\u305d\u308c\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\uff1a\u5b89\u5168\u3067\u306a\u3044\u30a4\u30f3\u30dd\u30fc\u30c8\u3092\u8ffd\u52a0\u3057\u306a\u3044\u3053\u3068\uff01<\/p>\n\n\n\n<p>\u4e0d\u6b63\u306a\u64cd\u4f5c\u3092\u5b9f\u884c\u3057\u3088\u3046\u3068\u3059\u308b\u30b3\u30fc\u30c9\u3084\u3001\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u305f\u30b3\u30fc\u30c9\u306b\u901a\u5e38\u306e Python \u30a8\u30e9\u30fc\u304c\u3042\u308b\u5834\u5408\u3001\u5b9f\u884c\u306f\u505c\u6b62\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3092\u4f7f\u3046\u3053\u3068\u3082\u3067\u304d\u308b\u3002\u00a0<a href=\"https:\/\/e2b.dev\/docs#what-is-e2-b\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">E2B\u30b3\u30fc\u30c9\u30a8\u30b0\u30bc\u30ad\u30e5\u30fc\u30bf<\/a>\u00a0\u30ed\u30fc\u30ab\u30eb\u306ePython\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u306e\u4ee3\u308f\u308a\u306b\u3001\u6700\u521d\u306b\u00a0<a href=\"https:\/\/e2b.dev\/dashboard?tab=keys\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">\u3092\u8a2d\u5b9a\u3059\u308b\u3002\u00a0<code>E2B_API_KEY<\/code>\u00a0\u74b0\u5883\u5909\u6570<\/a>\u00a0\u305d\u3057\u3066\u00a0<code>use_e2b_executor=True<\/code>\u00a0\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306e\u521d\u671f\u5316\u6642\u306b<\/p>\n\n\n\n<p>\u30b3\u30fc\u30c9\u5b9f\u884c\u306e\u8a73\u7d30\u00a0<a href=\"https:\/\/huggingface.co\/docs\/smolagents\/tutorials\/secure_code_execution\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f<\/a>.<\/p>\n\n\n\n<p>\u307e\u305f\u3001JSON\u306e\u3088\u3046\u306a\u30d6\u30ed\u30d6\u3068\u3057\u3066\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u8a18\u8ff0\u3059\u308b\u3001\u5e83\u304f\u4f7f\u308f\u308c\u3066\u3044\u308b\u65b9\u6cd5\u3082\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059\u3002\u00a0<a href=\"https:\/\/huggingface.co\/docs\/smolagents\/v1.2.2\/en\/reference\/agents#smolagents.ToolCallingAgent\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">\u30c4\u30fc\u30eb\u30b3\u30fc\u30ea\u30f3\u30b0\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8<\/a>\u3068\u540c\u3058\u3088\u3046\u306b\u6a5f\u80fd\u3059\u308b\u3002\u00a0<a href=\"https:\/\/huggingface.co\/docs\/smolagents\/v1.2.2\/en\/reference\/agents#smolagents.CodeAgent\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">\u30b3\u30fc\u30c9\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8<\/a>\u52ff\u8ad6\u3001\u305d\u3093\u306a\u3053\u3068\u306f\u306a\u3044\u3002\u00a0<code>\u8ffd\u52a0\u8a8d\u53ef\u8f38\u5165<\/code>\u00a0\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u306a\u3044\u304b\u3089\u3060\uff1a<\/p>\n\n\n\n<p>\u30b3\u30d4\u30fc<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from smolagents import ToolCallingAgent\n\nagent = ToolCallingAgent(tools=[], model=model)\nagent.run(\"URL 'https:\/\/huggingface.co\/blog'\u306b\u3042\u308b\u30da\u30fc\u30b8\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u53d6\u5f97\u3057\u3066\u3082\u3089\u3048\u307e\u3059\u304b\uff1f\")<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/huggingface.co\/docs\/smolagents\/guided_tour#inspecting-an-agent-run\" target=\"_blank\" rel=\"noopener\"><\/a>\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u30e9\u30f3\u306e\u691c\u67fb<\/h3>\n\n\n\n<p>\u4ee5\u4e0b\u306f\u3001\u8d70\u884c\u5f8c\u306b\u4f55\u304c\u8d77\u3053\u3063\u305f\u304b\u3092\u8abf\u3079\u308b\u306e\u306b\u4fbf\u5229\u306a\u5c5e\u6027\u3067\u3042\u308b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u30ed\u30b0<\/code>\u00a0\u306f\u3001\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306e\u8a73\u7d30\u306a\u30ed\u30b0\u3092\u4fdd\u5b58\u3057\u307e\u3059\u3002\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306e\u5b9f\u884c\u306e\u5404\u30b9\u30c6\u30c3\u30d7\u3067\u3001\u3059\u3079\u3066\u304c\u8f9e\u66f8\u306b\u683c\u7d0d\u3055\u308c\u3001\u305d\u308c\u304c\u00a0<code>\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u30ed\u30b0<\/code>.<\/li>\n\n\n\n<li>\u30e9\u30f3\u30cb\u30f3\u30b0\u00a0<code>agent.write_inner_memory_from_logs()<\/code>\u00a0\u306f\u3001LLM \u304c\u8868\u793a\u3059\u308b\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306e\u30ed\u30b0\u306e\u5185\u90e8\u30e1\u30e2\u30ea\u3092\u3001\u30c1\u30e3\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u30ea\u30b9\u30c8\u3068\u3057\u3066\u4f5c\u6210\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u30b7\u30b9\u30c6\u30e0\u30d7\u30ed\u30f3\u30d7\u30c8\u3068\u30bf\u30b9\u30af\u3092\u5225\u3005\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u306b\u4fdd\u5b58\u3057\u3001\u5404\u30b9\u30c6\u30c3\u30d7\u3054\u3068\u306b LLM \u306e\u51fa\u529b\u3092\u30e1\u30c3\u30bb\u30fc\u30b8\u3068\u3057\u3066\u4fdd\u5b58\u3057\u3001\u30c4\u30fc\u30eb\u30b3\u30fc\u30eb\u306e\u51fa\u529b\u3092\u5225\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3068\u3057\u3066\u4fdd\u5b58\u3057\u307e\u3059\u3002\u4f55\u304c\u8d77\u3053\u3063\u305f\u304b\u3092\u3088\u308a\u9ad8\u3044\u30ec\u30d9\u30eb\u3067\u898b\u305f\u3044\u5834\u5408\u306f\u3001\u3053\u308c\u3092\u4f7f\u3046\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/huggingface.co\/docs\/smolagents\/guided_tour#tools\" target=\"_blank\" rel=\"noopener\"><\/a>\u30c4\u30fc\u30eb<\/h2>\n\n\n\n<p>\u30c4\u30fc\u30eb\u306f\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306b\u3088\u3063\u3066\u4f7f\u7528\u3055\u308c\u308b\u539f\u5b50\u95a2\u6570\u3067\u3042\u308b\u3002LLM\u306b\u3088\u3063\u3066\u4f7f\u7528\u3055\u308c\u308b\u305f\u3081\u306b\u306f\u3001API\u3092\u69cb\u6210\u3059\u308b\u3044\u304f\u3064\u304b\u306e\u5c5e\u6027\u3082\u5fc5\u8981\u3067\u3042\u308a\u3001LLM\u306b\u3053\u306e\u30c4\u30fc\u30eb\u3092\u3069\u306e\u3088\u3046\u306b\u547c\u3073\u51fa\u3059\u304b\u3092\u8a18\u8ff0\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u308b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u540d\u524d<\/li>\n\n\n\n<li>\u8a18\u8ff0<\/li>\n\n\n\n<li>\u5165\u529b\u30bf\u30a4\u30d7\u3068\u8aac\u660e<\/li>\n\n\n\n<li>\u51fa\u529b\u30bf\u30a4\u30d7<\/li>\n<\/ul>\n\n\n\n<p>\u4f8b\u3048\u3070\u00a0<a href=\"https:\/\/huggingface.co\/docs\/smolagents\/v1.2.2\/en\/reference\/tools#smolagents.PythonInterpreterTool\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">PythonInterpreterTool<\/a>\u540d\u524d\u3001\u8aac\u660e\u3001\u5165\u529b\u8aac\u660e\u3001\u51fa\u529b\u30bf\u30a4\u30d7\u3001\u305d\u3057\u3066\u00a0<code>\u524d\u65b9<\/code>\u00a0\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3059\u308b\u3002<\/p>\n\n\n\n<p>\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u304c\u521d\u671f\u5316\u3055\u308c\u308b\u3068\u304d\u3001\u30c4\u30fc\u30eb\u5c5e\u6027\u306f\u3001\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306e\u30b7\u30b9\u30c6\u30e0\u30d7\u30ed\u30f3\u30d7\u30c8\u306b\u7d44\u307f\u8fbc\u307e\u308c\u308b\u30c4\u30fc\u30eb\u306e\u8aac\u660e\u3092\u751f\u6210\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306f\u3001\u3069\u306e\u30c4\u30fc\u30eb\u3092\u4f7f\u7528\u3067\u304d\u308b\u304b\u3001\u307e\u305f\u305d\u306e\u7406\u7531\u3092\u77e5\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/huggingface.co\/docs\/smolagents\/guided_tour#default-toolbox\" target=\"_blank\" rel=\"noopener\"><\/a>\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30c4\u30fc\u30eb\u30dc\u30c3\u30af\u30b9<\/h3>\n\n\n\n<p>Transformers \u306b\u306f\u3001\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306b\u529b\u3092\u4e0e\u3048\u308b\u305f\u3081\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30c4\u30fc\u30eb\u30dc\u30c3\u30af\u30b9\u304c\u4ed8\u5c5e\u3057\u3066\u3044\u307e\u3059\u3002&nbsp;<code>add_base_tools = True<\/code>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>DuckDuckGo\u30a6\u30a7\u30d6\u691c\u7d22*\u3002<\/strong>DuckDuckGo\u30d6\u30e9\u30a6\u30b6\u3092\u4f7f\u3063\u3066\u30a6\u30a7\u30d6\u691c\u7d22\u3092\u884c\u3046\u3002<\/li>\n\n\n\n<li><strong>Python\u30b3\u30fc\u30c9\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf<\/strong>LLM\u304c\u751f\u6210\u3057\u305fPython\u30b3\u30fc\u30c9\u3092\u5b89\u5168\u306a\u74b0\u5883\u3067\u5b9f\u884c\u3057\u307e\u3059\u3002\u3053\u306e\u30c4\u30fc\u30eb\u306f\u00a0<a href=\"https:\/\/huggingface.co\/docs\/smolagents\/v1.2.2\/en\/reference\/agents#smolagents.ToolCallingAgent\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">\u30c4\u30fc\u30eb\u30b3\u30fc\u30ea\u30f3\u30b0\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8<\/a>\u00a0\u3067\u521d\u671f\u5316\u3059\u308b\u3068\u00a0<code>add_base_tools=True<\/code>\u30b3\u30fc\u30c9\u30d9\u30fc\u30b9\u306e\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306f\u3001\u3059\u3067\u306b\u30cd\u30a4\u30c6\u30a3\u30d6\u306bPython\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3067\u304d\u308b\u3002<\/li>\n\n\n\n<li><strong>\u30c8\u30e9\u30f3\u30b9\u30af\u30e9\u30a4\u30d0\u30fc<\/strong>Whisper-Turbo\u4e0a\u306b\u69cb\u7bc9\u3055\u308c\u305f\u97f3\u58f0\u30c6\u30ad\u30b9\u30c8\u5909\u63db\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u30c4\u30fc\u30eb\u3092\u624b\u52d5\u3067\u4f7f\u7528\u3059\u308b\u306b\u306f\u3001\u5f15\u6570\u3092\u6307\u5b9a\u3057\u3066\u547c\u3073\u51fa\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30b3\u30d4\u30fc<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from smolagents import DuckDuckGoSearchTool\n\nsearch_tool = DuckDuckGoSearchTool()\nprint(search_tool(\"Who's the current president of Russia?\"))<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/huggingface.co\/docs\/smolagents\/guided_tour#create-a-new-tool\" target=\"_blank\" rel=\"noopener\"><\/a>\u65b0\u3057\u3044\u30c4\u30fc\u30eb\u3092\u4f5c\u6210\u3059\u308b<\/h3>\n\n\n\n<p>Hugging Face\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u30c4\u30fc\u30eb\u3067\u30ab\u30d0\u30fc\u3055\u308c\u3066\u3044\u306a\u3044\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u306e\u305f\u3081\u306b\u3001\u72ec\u81ea\u306e\u30c4\u30fc\u30eb\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u4e0e\u3048\u3089\u308c\u305f\u30bf\u30b9\u30af\u306b\u5bfe\u3057\u3066\u6700\u3082\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3055\u308c\u305f\u30e2\u30c7\u30eb\u3092\u30cf\u30d6\u304b\u3089\u8fd4\u3059\u30c4\u30fc\u30eb\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u304b\u3089\u59cb\u3081\u308b\u3002<\/p>\n\n\n\n<p>\u30b3\u30d4\u30fc<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from huggingface_hub import list_models\n\n\u30bf\u30b9\u30af = \"\u30c6\u30ad\u30b9\u30c8\u5206\u985e\"\n\nmost_downloaded_model = next(iter(list_models(filter=task, sort=\"downloads\", direction=-1)))\nprint(most_downloaded_model.id)<\/pre>\n\n\n\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u306f\u3001\u95a2\u6570\u3067\u30e9\u30c3\u30d7\u3057\u3066\u00a0<code>\u5de5\u5177<\/code>\u00a0\u30c7\u30b3\u30ec\u30fc\u30bf\u30fc\u3092\u4f7f\u7528\u3057\u307e\u3059\uff1a\u306e\u30b5\u30d6\u30af\u30e9\u30b9\u3068\u3057\u3066\u76f4\u63a5\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u00a0<a href=\"https:\/\/huggingface.co\/docs\/smolagents\/v1.2.2\/en\/reference\/tools#smolagents.Tool\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">\u5de5\u5177<\/a>\u4f8b\u3048\u3070\u3001\u91cd\u3044\u30af\u30e9\u30b9\u5c5e\u6027\u3092\u521d\u671f\u5316\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<p>\u4e21\u65b9\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u3069\u306e\u3088\u3046\u306b\u6a5f\u80fd\u3059\u308b\u304b\u898b\u3066\u307f\u3088\u3046\uff1a<\/p>\n\n\n\n<p>\u30c4\u30fc\u30eb\u3067\u95a2\u6570\u3092\u88c5\u98fe\u3059\u308b<\/p>\n\n\n\n<p>\u30b5\u30d6\u30af\u30e9\u30b9\u30c4\u30fc\u30eb<\/p>\n\n\n\n<p>\u30b3\u30d4\u30fc<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from smolagents import tool\n\n\u30c4\u30fc\u30eb\ndef model_download_tool(task: str) -&gt; str\uff1a\n    \"\"\"\n    \u3053\u308c\u306f\u3001Hugging Face Hub\u4e0a\u3067\u4e0e\u3048\u3089\u308c\u305f\u30bf\u30b9\u30af\u306e\u6700\u3082\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3055\u308c\u305f\u30e2\u30c7\u30eb\u3092\u8fd4\u3059\u30c4\u30fc\u30eb\u3067\u3059\u3002\n    \u30c1\u30a7\u30c3\u30af\u30dd\u30a4\u30f3\u30c8\u306e\u540d\u524d\u3092\u8fd4\u3057\u307e\u3059\u3002\n\n    \u5f15\u6570\n        \u30bf\u30b9\u30af\uff1a\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u6570\u3092\u53d6\u5f97\u3059\u308b\u30bf\u30b9\u30af\u3002\n    \"\"\"\n    most_downloaded_model = next(iter(list_models(filter=task, sort=\"downloads\", direction=-1)))\n    return most_downloaded_model.id<\/pre>\n\n\n\n<p>\u3053\u306e\u6a5f\u80fd\u306f\u5fc5\u8981\u3060\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u660e\u78ba\u306a\u540d\u524d\u3002\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3092\u52d5\u304b\u3059LLM\u306e\u982d\u8133\u3092\u52a9\u3051\u308b\u305f\u3081\u306b\u3001\u3053\u306e\u30c4\u30fc\u30eb\u304c\u4f55\u3092\u3059\u308b\u306e\u304b\u3092\u5341\u5206\u306b\u8aac\u660e\u3067\u304d\u308b\u540d\u524d\u3067\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002\u3053\u306e\u30c4\u30fc\u30eb\u306f\u30bf\u30b9\u30af\u306b\u5bfe\u3057\u3066\u6700\u3082\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u6570\u306e\u591a\u3044\u30e2\u30c7\u30eb\u3092\u8fd4\u3059\u306e\u3067\u3001\u6b21\u306e\u3088\u3046\u306b\u540d\u4ed8\u3051\u307e\u3057\u3087\u3046\u3002\u00a0<code>\u30e2\u30c7\u30eb\u30fb\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u30fb\u30c4\u30fc\u30eb<\/code>.<\/li>\n\n\n\n<li>\u5165\u529b\u3068\u51fa\u529b\u306e\u4e21\u65b9\u306b\u30d2\u30f3\u30c8\u3092\u8868\u793a<\/li>\n\n\n\n<li>Args:'\u306e\u90e8\u5206\u3092\u542b\u3080\u8aac\u660e\u3067\u3001\u5404\u5f15\u6570\u304c\u8a18\u8ff0\u3055\u308c\u3066\u3044\u307e\u3059\uff08\u4eca\u56de\u306f\u30bf\u30a4\u30d7\u8868\u793a\u306a\u3057\u3067\u3001\u30bf\u30a4\u30d7\u30d2\u30f3\u30c8\u304b\u3089\u5f15\u304d\u51fa\u3055\u308c\u307e\u3059\uff09\u3002\u30c4\u30fc\u30eb\u540d\u3068\u540c\u69d8\u306b\u3001\u3053\u306e\u8aac\u660e\u306f\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3092\u52d5\u304b\u3059 LLM \u306e\u53d6\u6271\u8aac\u660e\u66f8\u3067\u3059\u3002\u3053\u308c\u3089\u306e\u8981\u7d20\u306f\u3059\u3079\u3066\u3001\u521d\u671f\u5316\u6642\u306b\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306e\u30b7\u30b9\u30c6\u30e0\u30d7\u30ed\u30f3\u30d7\u30c8\u306b\u81ea\u52d5\u7684\u306b\u7d44\u307f\u8fbc\u307e\u308c\u307e\u3059\uff01<\/li>\n<\/ul>\n\n\n\n<p>\u3053\u306e\u5b9a\u7fa9\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306f\u3001\u4ee5\u4e0b\u306e\u30c4\u30fc\u30eb\u30b9\u30ad\u30fc\u30de\u3068\u540c\u3058\u3067\u3042\u308b\u3002\u00a0<code>apply_chat_template<\/code>\u552f\u4e00\u306e\u9055\u3044\u306f\u00a0<code>\u5de5\u5177<\/code>\u00a0decorator:\u30c4\u30fc\u30eb\u4f7f\u7528API\u306e\u8a73\u7d30\u3092\u8aad\u3080\u00a0<a href=\"https:\/\/huggingface.co\/blog\/unified-tool-use#passing-tools-to-a-chat-template\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">\u3053\u308c<\/a>.<\/p>\n\n\n\n<p>\u305d\u306e\u5f8c\u3001\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3092\u76f4\u63a5\u521d\u671f\u5316\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<p>\u30b3\u30d4\u30fc<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from smolagents import CodeAgent, HfApiModel\nagent = CodeAgent(tools=[model_download_tool], model=HfApiModel())\nagent.run(\n    \"Hugging Face Hub\u306e'text-to-video'\u30bf\u30b9\u30af\u3067\u6700\u3082\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3055\u308c\u305f\u30e2\u30c7\u30eb\u306e\u540d\u524d\u3092\u6559\u3048\u3066\u3082\u3089\u3048\u307e\u3059\u304b\uff1f\"\n)<\/pre>\n\n\n\n<p>\u6b21\u306e\u3088\u3046\u306a\u30ed\u30b0\u304c\u8868\u793a\u3055\u308c\u308b\uff1a<\/p>\n\n\n\n<p>\u30b3\u30d4\u30fc<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u30cb\u30e5\u30fc\u30e9\u30f3\n\n\u30cf\u30b0\u3059\u308b\u9854\u300d\u306e\u30bf\u30b9\u30af\u3067\u6700\u3082\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3055\u308c\u305f\u30e2\u30c7\u30eb\u306e\u540d\u524d\u3092\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3002\nHugging Face Hub\u306e\u30bf\u30b9\u30af\u3092\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3002                                                            \u2502\n\n\u2570\u2500 HfApiModel - Qwen\/Qwen2.5-Coder-32B-Instruct \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\n\u3053\u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\uff1a\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 1 model_name = model_download_tool(task=\"text-to-video\") \u2502.\n\u2502 2 print(\u30e2\u30c7\u30eb\u540d)\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\u5b9f\u884c\u30ed\u30b0\n\u30d0\u30a4\u30c8\u30c0\u30f3\u30b9\uff0f\u30a2\u30cb\u30e1\u30a4\u30c8\u30c7\u30a3\u30d5\u30fb\u30e9\u30a4\u30c8\u30cb\u30f3\u30b0\n\n\u30a2\u30a6\u30c8\u306a\u3057\n[\u30b9\u30c6\u30c3\u30d70\uff1a\u6642\u95930.27\u79d2\uff5c\u5165\u529b\u30c8\u30fc\u30af\u30f3\uff1a2,069\uff5c\u51fa\u529b\u30c8\u30fc\u30af\u30f3\uff1a60].\n\u30b9\u30c6\u30c3\u30d7 1\n\u3053\u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\uff1a\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 1 final_answer(\"ByteDance\/AnimateDiff-Lightning\")\u2502\u3067\u3059\u3002\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\u30a2\u30a6\u30c8\u2500\u2500\u6700\u7d42\u56de\u7b54ByteDance\/AnimateDiff-Lightning\n[\u30b9\u30c6\u30c3\u30d71\uff1a\u6240\u8981\u6642\u95930.10\u79d2\uff5c\u5165\u529b\u30c8\u30fc\u30af\u30f3\uff1a4,288\uff5c\u51fa\u529b\u30c8\u30fc\u30af\u30f3\uff1a148\uff3d\u3002\n\u30a2\u30a6\u30c8[20]: 'ByteDance\/AnimateDiff-Lightning'<\/pre>\n\n\n\n<p>\u30c4\u30fc\u30eb\u306b\u3064\u3044\u3066\u306e\u8a73\u7d30\u306f\u00a0<a href=\"https:\/\/huggingface.co\/docs\/smolagents\/tutorials\/tools#what-is-a-tool-and-how-to-build-one\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">\u5c02\u7528\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/huggingface.co\/docs\/smolagents\/guided_tour#multi-agents\" target=\"_blank\" rel=\"noopener\"><\/a>\u30de\u30eb\u30c1\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8<\/h2>\n\n\n\n<p>\u30de\u30eb\u30c1\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u30b7\u30b9\u30c6\u30e0\u306f\u3001\u30de\u30a4\u30af\u30ed\u30bd\u30d5\u30c8\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u5c0e\u5165\u3055\u308c\u305f\u3002\u00a0<a href=\"https:\/\/huggingface.co\/papers\/2308.08155\" target=\"_blank\" rel=\"noopener\">\u30aa\u30fc\u30c8<\/a><a href=\"https:\/\/huggingface.co\/papers\/2308.08155\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">o<\/a><a href=\"https:\/\/huggingface.co\/papers\/2308.08155\" target=\"_blank\" rel=\"noopener\">\u30b8\u30a7\u30f3<\/a>.<\/p>\n\n\n\n<p>\u3053\u306e\u30bf\u30a4\u30d7\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u306f\u30011\u3064\u306e\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3060\u3051\u3067\u306a\u304f\u3001\u8907\u6570\u306e\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u304c\u5354\u529b\u3057\u3066\u30bf\u30b9\u30af\u3092\u89e3\u6c7a\u3059\u308b\u3002\u3053\u308c\u306f\u7d4c\u9a13\u7684\u306b\u307b\u3068\u3093\u3069\u306e\u30d9\u30f3\u30c1\u30de\u30fc\u30af\u3067\u3088\u308a\u826f\u3044\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u3082\u305f\u3089\u3059\u3002\u3053\u306e\u3088\u3046\u306b\u6027\u80fd\u304c\u5411\u4e0a\u3059\u308b\u7406\u7531\u306f\u3001\u6982\u5ff5\u7684\u306b\u5358\u7d14\u3067\u3042\u308b\u3002\u591a\u304f\u306e\u30bf\u30b9\u30af\u3067\u306f\u3001\u3059\u3079\u3066\u3092\u3053\u306a\u3059\u30b7\u30b9\u30c6\u30e0\u3092\u4f7f\u3046\u3088\u308a\u3082\u3001\u30b5\u30d6\u30bf\u30b9\u30af\u306b\u30e6\u30cb\u30c3\u30c8\u3092\u7279\u5316\u3055\u305b\u308b\u3053\u3068\u3092\u597d\u3080\u304b\u3089\u3067\u3042\u308b\u3002\u3053\u3053\u3067\u3001\u5225\u3005\u306e\u30c4\u30fc\u30eb\u30bb\u30c3\u30c8\u3068\u30e1\u30e2\u30ea\u3092\u6301\u3064\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3092\u6301\u3064\u3053\u3068\u3067\u3001\u52b9\u7387\u7684\u306a\u7279\u6b8a\u5316\u3092\u5b9f\u73fe\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002\u4f8b\u3048\u3070\u3001\u306a\u305c\u30b3\u30fc\u30c9\u751f\u6210\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306e\u30e1\u30e2\u30ea\u3092\u3001\u30a6\u30a7\u30d6\u691c\u7d22\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u304c\u8a2a\u554f\u3057\u305f\u30a6\u30a7\u30d6\u30da\u30fc\u30b8\u306e\u3059\u3079\u3066\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u3067\u3044\u3063\u3071\u3044\u306b\u3059\u308b\u306e\u3067\u3057\u3087\u3046\u304b\uff1f\u5225\u3005\u306b\u3057\u3066\u304a\u3044\u305f\u307b\u3046\u304c\u3088\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u3067\u7c21\u5358\u306b\u968e\u5c64\u578b\u30de\u30eb\u30c1\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u30b7\u30b9\u30c6\u30e0\u3092\u69cb\u7bc9\u3067\u304d\u307e\u3059\u3002&nbsp;<code>smolagents<\/code>.<\/p>\n\n\n\n<p>\u305d\u306e\u305f\u3081\u306b\u306f\u3001\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3092\u00a0<a href=\"https:\/\/huggingface.co\/docs\/smolagents\/v1.2.2\/en\/reference\/agents#smolagents.ManagedAgent\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">\u30de\u30cd\u30fc\u30b8\u30c9\u30fb\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8<\/a>\u00a0\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u5fc5\u8981\u3067\u3059\u3002\u3053\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u5f15\u6570\u3092\u5fc5\u8981\u3068\u3059\u308b\u00a0<code>\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8<\/code>,\u00a0<code>\u540d\u79f0<\/code>\u305d\u3057\u3066\u00a0<code>\u8a18\u8ff0<\/code>\u3053\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u306f\u3001\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306e\u30b7\u30b9\u30c6\u30e0\u30d7\u30ed\u30f3\u30d7\u30c8\u306b\u57cb\u3081\u8fbc\u307e\u308c\u3001\u30c4\u30fc\u30eb\u306e\u5834\u5408\u3068\u540c\u69d8\u306b\u3001\u3053\u306e\u30de\u30cd\u30fc\u30b8\u30c9\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3092\u547c\u3073\u51fa\u3059\u65b9\u6cd5\u3092\u77e5\u3089\u305b\u308b\u3002<\/p>\n\n\n\n<p>\u7279\u5b9a\u306e\u30a6\u30a7\u30d6\u691c\u7d22\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3092\u7ba1\u7406\u3059\u308b\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3092\u4f5c\u6210\u3059\u308b\u4f8b\u3092\u793a\u3057\u307e\u3059\u3002\u00a0<a href=\"https:\/\/huggingface.co\/docs\/smolagents\/v1.2.2\/en\/reference\/tools#smolagents.DuckDuckGoSearchTool\" target=\"_blank\" rel=\"noopener\">\u30c0\u30c3\u30af\u30c7\u30e5\u30c3\u30af<\/a><a href=\"https:\/\/huggingface.co\/docs\/smolagents\/v1.2.2\/en\/reference\/tools#smolagents.DuckDuckGoSearchTool\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">k<\/a><a href=\"https:\/\/huggingface.co\/docs\/smolagents\/v1.2.2\/en\/reference\/tools#smolagents.DuckDuckGoSearchTool\" target=\"_blank\" rel=\"noopener\">\u30b4\u30fc\u30b5\u30fc\u30c1\u30c4\u30fc\u30eb<\/a>:<\/p>\n\n\n\n<p>\u30b3\u30d4\u30fc<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from smolagents import CodeAgent, HfApiModel, DuckDuckGoSearchTool, ManagedAgent\n\nmodel = HfApiModel()\n\nweb_agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=model)\n\nmanaged_web_agent = ManagedAgent(\n    agent=web_agent\u3001\n    name=\"web_search\"\u3001\n    description=\"\u30a6\u30a7\u30d6\u691c\u7d22\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002\u5f15\u6570\u3068\u3057\u3066\u30af\u30a8\u30ea\u3092\u6e21\u3057\u3066\u304f\u3060\u3055\u3044\u3002\"\n)\n\nmanager_agent = CodeAgent(\n    tools=[], model=model, managed_agents=[managed_web_agent].\n)\n\nmanager_agent.run(\"Hugging Face\u306eCEO\u306f\u8ab0\u3067\u3059\u304b\uff1f\")<\/pre>\n\n\n\n<p>\u52b9\u7387\u7684\u306a\u30de\u30eb\u30c1\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u5b9f\u88c5\u306e\u8a73\u7d30\u306a\u4f8b\u306b\u3064\u3044\u3066\u306f\u3001\u4ee5\u4e0b\u3092\u53c2\u7167\u306e\u3053\u3068\u3002\u00a0<a href=\"https:\/\/huggingface.co\/blog\/beating-gaia\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">\u30de\u30eb\u30c1\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u30b7\u30b9\u30c6\u30e0\u3092GAIA\u30ea\u30fc\u30c0\u30fc\u30dc\u30fc\u30c9\u306e\u30c8\u30c3\u30d7\u306b\u62bc\u3057\u4e0a\u3052\u305f\u65b9\u6cd5<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/huggingface.co\/docs\/smolagents\/guided_tour#talk-with-your-agent-and-visualize-its-thoughts-in-a-cool-gradio-interface\" target=\"_blank\" rel=\"noopener\"><\/a>\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3068\u4f1a\u8a71\u3057\u3001\u30af\u30fc\u30eb\u306aGradio\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u3067\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306e\u8003\u3048\u3092\u8996\u899a\u5316\u3059\u308b<\/h2>\n\n\n\n<p>\u3092\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u308b\u3002&nbsp;<code>\u30b0\u30e9\u30c7\u30a3\u30aaUI<\/code>&nbsp;\u3092\u4f7f\u7528\u3057\u3066\u3001\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306b\u30bf\u30b9\u30af\u3092\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u306b\u9001\u4fe1\u3057\u3001\u305d\u306e\u601d\u8003\u3068\u5b9f\u884c\u30d7\u30ed\u30bb\u30b9\u3092\u89b3\u5bdf\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<p>\u30b3\u30d4\u30fc<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from smolagents import (\n    load_tool\u3001\n    CodeAgent\u3001\n    HfApiModel\u3001\n    GradioUI\n)\n\n<em># \u30cf\u30d6\u304b\u3089\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\u30c4\u30fc\u30eb<\/em>\nimage_generation_tool = load_tool(\"m-ric\/text-to-image\")\n\nmodel = HfApiModel(model_id)\n\n<em># \u753b\u50cf\u751f\u6210\u30c4\u30fc\u30eb\u3067\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3092\u521d\u671f\u5316\u3059\u308b<\/em>\nagent = CodeAgent(tools=[image_generation_tool], model=model)\n\nGradioUI(agent).launch()<\/pre>\n\n\n\n<p>\u30dc\u30f3\u30cd\u30c3\u30c8\u306e\u4e0b\u3067\u306f\u3001\u30e6\u30fc\u30b6\u304c\u65b0\u3057\u3044\u56de\u7b54\u3092\u30bf\u30a4\u30d7\u3059\u308b\u3068\u3001\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306f&nbsp;<code>agent.run(user_request, reset=False)<\/code>.\u305d\u306e&nbsp;<code>reset=False<\/code>&nbsp;\u30d5\u30e9\u30b0\u306f\u3001\u65b0\u3057\u3044\u30bf\u30b9\u30af\u3092\u958b\u59cb\u3059\u308b\u524d\u306b\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306e\u30e1\u30e2\u30ea\u304c\u30d5\u30e9\u30c3\u30b7\u30e5\u3055\u308c\u306a\u3044\u3053\u3068\u3092\u610f\u5473\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306a\u4f7f\u3044\u65b9\u3082\u3067\u304d\u307e\u3059\u3002&nbsp;<code>reset=False<\/code>&nbsp;\u4ed6\u306e\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u4f1a\u8a71\u3092\u7d9a\u3051\u308b\u305f\u3081\u306e\u5f15\u6570\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/huggingface.co\/docs\/smolagents\/guided_tour#next-steps\" target=\"_blank\" rel=\"noopener\"><\/a>\u6b21\u306e\u30b9\u30c6\u30c3\u30d7<\/h2>\n\n\n\n<p>\u3088\u308a\u8a73\u3057\u3044\u4f7f\u3044\u65b9\u306f\u3001\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/huggingface.co\/docs\/smolagents\/tutorials\/secure_code_execution\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">\u30b3\u30fc\u30c9\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306e\u4ed5\u7d44\u307f\u306e\u8aac\u660e<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/huggingface.co\/docs\/smolagents\/tutorials\/building_good_agents\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">\u826f\u3044\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306e\u4f5c\u308a\u65b9<\/a>.<\/li>\n\n\n\n<li><a href=\"https:\/\/huggingface.co\/docs\/smolagents\/tutorials\/building_good_agents\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">\u9053\u5177\u306e\u4f7f\u3044\u65b9\u5fb9\u5e95\u30ac\u30a4\u30c9<\/a>.<\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>In this guided visit, you will learn how to build an agent, how to run it, and how to customize it to make it work better for your use-case. Building your agent To initialize a minimal agent, you need at least these two arguments: Once you have these two arguments,\u00a0tools\u00a0and\u00a0model, you can create an agent&#8230;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"doc_category":[7],"doc_tag":[],"class_list":["post-587","docs","type-docs","status-publish","hentry","doc_category-get-started"],"year_month":"2026-04","word_count":1967,"total_views":"5541","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"smolagents","author_nicename":"wd-gstargmail-com","author_url":"https:\/\/smolagents.org\/ja\/author\/wd-gstargmail-com\/"},"doc_category_info":[{"term_name":"Get started","term_url":"https:\/\/smolagents.org\/ja\/docs-category\/get-started\/"}],"doc_tag_info":[],"_links":{"self":[{"href":"https:\/\/smolagents.org\/ja\/wp-json\/wp\/v2\/docs\/587","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/smolagents.org\/ja\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/smolagents.org\/ja\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/smolagents.org\/ja\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/smolagents.org\/ja\/wp-json\/wp\/v2\/comments?post=587"}],"version-history":[{"count":1,"href":"https:\/\/smolagents.org\/ja\/wp-json\/wp\/v2\/docs\/587\/revisions"}],"predecessor-version":[{"id":588,"href":"https:\/\/smolagents.org\/ja\/wp-json\/wp\/v2\/docs\/587\/revisions\/588"}],"wp:attachment":[{"href":"https:\/\/smolagents.org\/ja\/wp-json\/wp\/v2\/media?parent=587"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/smolagents.org\/ja\/wp-json\/wp\/v2\/doc_category?post=587"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/smolagents.org\/ja\/wp-json\/wp\/v2\/doc_tag?post=587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}