UiPath Documentation
agents
latest
false
Agents ガイド
重要 :
このコンテンツの一部は機械翻訳によって処理されており、完全な翻訳を保証するものではありません。 新しいコンテンツの翻訳は、およそ 1 ~ 2 週間で公開されます。

関数

Coded functions as agent tools, letting an agent run custom Python code as a deterministic, process-based tool alongside automations and API workflows.

The coded function tool lets an agent run custom Python code as a tool. A function encapsulates deterministic logic — data transformations, calculations, or calls to external systems — that the agent invokes when its reasoning calls for it, then reasons over the returned result.

A coded function behaves like the other process-based tools available to an agent, such as API workflows, automations, or agent tools. The agent passes input arguments to the function, the function runs its Python code, and the agent receives the structured output.

Functions are created in Studio Web. For details on writing, packaging, and publishing functions, see the Functions user guide.

How agents use functions

Once a function is available in your solution, it appears as a selectable tool within the Tools section of an agent definition in Studio Web. Each tool carries a description that helps the agent understand its purpose and when to use it.

At runtime, the agent passes input parameters to the function, the function executes its Python logic, and the result returns to the agent as structured output for the next step in its plan. Because the logic is deterministic code, a function returns the same output for the same input, which makes it suited to precise operations that the language model should not perform through reasoning alone.

Like other tool types, coded functions support the platform's governance controls. You can set up guardrails to control when and how a function is invoked, and tool simulations to test the agent's reasoning without running the real code.

Adding a function as a tool

You can add an existing function from your available resources, or create a new one without leaving the agent.

  1. [定義] パネルの [ツール] セクションで、[ツールを追加] を選択します。
  2. Select Function.
  3. Add the function:
    • To use an existing function, search for it or select it from the available resources.
    • To create a new function, select Create new. The function creation wizard opens inside the solution.
  4. Use the system prompt to describe the function's purpose and when the agent should use it. For any arguments, provide a description to help the agent use them effectively.

Monitoring function execution

When an agent runs a coded function tool, you can inspect the execution in two places:

  • Agent trace — After a debug run, the execution trail includes a tool call for the function, showing the input arguments passed to it and the output it returned.
  • Orchestrator — The function runs as a process. Under Monitoring > Jobs in Orchestrator, the function appears as a job, alongside the agent's other job executions.

このページは役に立ちましたか?

接続

ヘルプ リソース サポート

学習する UiPath アカデミー

質問する UiPath フォーラム

最新情報を取得