๊ฐ€์ž… ํ›„ ์ดˆ๋Œ€ ๋งํฌ๋ฅผ ๊ณต์œ ํ•˜๋ฉด ๋™์˜์ƒ ์žฌ์ƒ ๋ฐ ์ดˆ๋Œ€ ๋ณด์ƒ์„ ๋ฐ›์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

cv usk
@cv_usk
AI / Software Research Notes AI Agent, LLMOps, MLOps, Software Architecture ๆŠ•็จฟใฏๅ€‹ไบบใฎๆ„่ฆ‹ใงใ™ใ€‚
๊ฐ€์ž… May 2026
258 ํŒ”๋กœ์ž‰ ์ค‘    220 ํŒฌ
# Useful but Little-Known Features of OpenAI Agent SDK ๐ŸŒ Too many tools eating up your token budget? There's a way to load tools only when needed. Combining `defer_loading` with `ToolSearchTool`, the model can search for and dynamically load only the tools it needs, dramatically reducing token consumption. ๐Ÿ“Œ Title: Hosted Tool Search / tool_namespace / defer_loading ๐Ÿ”— URL: ๐Ÿงฉ Overview Tools decorated with `@function_tool(defer_loading=True)` are excluded from the tool list on the initial model call. By adding `ToolSearchTool()` to the agent, the model first searches for relevant tools and loads only the ones it needs. You can also group tools using `tool_namespace`. This is a powerful feature for optimizing token usage in agents with many tools. Note that this feature is only available with `OpenAIResponsesModel`. ๐Ÿ›  How to use it ```python from agents import Agent, function_tool from agents.tool import ToolSearchTool @function_tool(defer_loading=True, tool_namespace="analytics") def run_report(report_type: str) -> str: return generate_report(report_type) @function_tool(defer_loading=True, tool_namespace="analytics") def export_csv(dataset: str) -> str: return create_csv(dataset) @function_tool(defer_loading=True, tool_namespace="admin") def manage_users(action: str) -> str: return user_management(action) agent = Agent( name="assistant", tools=[ ToolSearchTool(), # Enable tool search run_report, export_csv, manage_users, ], ) ``` ๐Ÿ— Building it into production ใƒปReduce token costs for agents with dozens to hundreds of tools ใƒปUse `tool_namespace` to logically group tools and improve search accuracy ใƒปKeep frequently used tools at `defer_loading=False` (default) and defer only rarely used ones ใƒปScale tool count without worrying about prompt size ๐Ÿ’ก Use cases ๐Ÿงฐ Tool management for feature-rich SaaS agents ๐Ÿ“Š On-demand loading of analytics and reporting tools ๐Ÿ”ง Showing admin tools only when needed ๐Ÿš€ Ensuring tool count scalability โš ๏ธ Watch out This feature works only with `OpenAIResponsesModel` and is not available with other model providers. Deferred tools are unavailable on the first turn, so they're not suitable for tools that must respond immediately to the user's initial request. โœจ Load "only the right tools at the right time" with tool search for smarter agents. #OpenAIAgentSDK# #AIAgent#
๋” ๋ณด๊ธฐ