Embed your agent on a web site
You can embed your agent on other sites with an IFRAME
Use the SteamshipWidgetTransport
Mixin (opens in a new tab) to give your agent a web-based widget you can interact with.
A full working example is here (opens in a new tab).
You can copy and paste this agent into your api.py
file or use it as a reference.
Mixins
A Mixin is just a way to add a bundle of functionality to your AgentService
. Mixins can include new API endpoints, async processing pipelines, and webhooks.
Adding the SteamshipWidgetTransport
Mixin
- Add
SteamshipWidgetTransport
to the staticUSED_MIXIN_CLASSES
list in your AgentService - Register
SteamshipWidgetTransport
in your AgentService__init__
withself.add_mixin(SteamshipWidgetTransport(self.client, self, self.agent))
Using the Web Widget
After deploying, just create an instance from the web.
That will take you to a web page that contains a chat window as well as other management tools for your agent.
Embedding the Web Widget
At the top-right, you will find an Embed widget with instructions for placing this chat window on other web pages.