Custom actions
Custom actions allow your agents to utilize external services via API calls. Agenthost supports using custom actions with the ability to call essentially any external api. In order to do so, you will need to create a valid OpenAPI schema for your action.
The OpenAI action schema is less strict than Agenthost's action schema. This means that Agenthost's schema wil always work on OpenAI but OpenAI's schema may not work in Agenthost.
In order to create an action on Agenthost, you'll need to create an OpenAPI schema. If you do not know how to create an OpenAPI schema for the API's you would like your agent to connect to, we highly recommend following this guide by OpenAI.
Once you have the first draft of your OpenAPI schema, you should validate that your schema is correct. We recommend using this validator to confirm your schema is valid.
Go to Validate Text then copy and paste your OpenAPI schema in the text box.
You should see a response like this.
As you can see the following OpenAPI schema is valid.
To create your custom action, do the following.
- Go to the workspace and select the agent you would like to add a custom action to.
- Select Custom Domains from the sidebar.
- Click the Create Action button to add a new custom action.
- Enter a title for your custom action. This is just for your reference.
- Copy and paste your valid OpenAPI schema.
- Enter any needed credentials and select a credential type.
- Be sure to update your instructions to tell your agent to use the new operations and actions based on their name. You can view the detected operations under Operations
Now that you have a valid OpenAPI schema pasted in the custom action, you should add any authentication tokens that are needed to authenticate the request. Agenthost will securly encrypt and store the credentials when used by your agent.