本文是《Agent Customization with Apex | 用 Apex 定制 Agent》的练习操作步骤。阅读原文请见:Agent Customization with Apex | 用 Apex 定制 Agent。
1. Build an Apex Agent Action
- Open the App Launcher and select Agentforce Studio.
- Click Agent Customization, then New Version.
- Under Subagents, select Answer Weather Questions.
- Under Actions Available For Reasoning, click Select action → Create a custom action.
- Action Name:
Check Weather; Description:This action will return the local weather information. - Reference Action Type Apex, Category Invocable Method, Reference Action Check Weather.
- Click Create and Open.
- Ensure
dateToCheckhas Require input to execute action checked. - For the
temperatureDescriptionoutput, check Show in conversation. - Click Save, then Commit Version twice, then Activate twice.
2. Test the Agent
- In Agentforce Builder, click Preview (Live Test Mode).
- Enter
What's the weather like this Monday?and press Enter. - If prompted, select the date for next Monday and submit.
- Review the steps and confirm the agent selected the Check Weather action.