Embed your agent
Once you build and deploy an agent, whether it’s based on our native studio or your external registered agent, SUPERWISE® provides an easy way to embed your deployable agent.
Users have three out-of-the-box embedding options:
Notice
The supplied code snippets differ depending on whether the agent is configured to require authentication or not. Therefore, if you change your authentication settings, please make sure to update your code snippet accordingly.
SDK
If you are a Python developer, this will be the best option for you. Use our SDK to query the deployable agent.
To get started with the SDK, please visit here.
agent_response = sw.agent.ask_worker(agent_id=agent.id, input="your question here", api_token=api_token)
API
If you use the deployable agent as a backend service and want to develop automation based on it or build your own UI on top, and you are not a Python developer, use our REST API “ option. The provided code snippet includes an example of how to query the API.
iFrame
SUPERWISE® provides an out-of-the-box chat client experience. The iframe includes a built-in UI for chatting with the deployable agent, feedback buttons, and relevant interactions to enable a good, usable generic chat experience. Simply embed the IFrame code snippet in your website, and you will get a fully functional chat experience already connected to our deployed backend.
Use in trusted domains only
Ensure that your website and the iframe are running on trusted domains to maintain the security of the API token.
Give It a Try!
You can test the iframe by using the React code example and embedding it in this React playground. Just make sure to insert your Agent ID and API key.
Updated 6 days ago