Generate Embed Code
gnosari_embed_codeGenerate an HTML embed snippet for the Gnosari chat widget.
Returns a ready-to-paste HTML snippet that adds the chat widget to any website. The snippet carries the Gnosari's public URI -- the only value the widget loader resolves an agent by -- so the Gnosari must have a public URI before it can be embedded.
Only settings that differ from the loader's own defaults are printed,
which keeps the snippet to the smallest thing that renders a working
widget. Paste it right before the closing </body> tag of every page
that should show the chat.
Raises: AgentNotFoundError: The Gnosari does not exist, or belongs to another account. AgentValidationError: The Gnosari has no public URI yet.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| position | No | Where the bubble appears on screen (bubble mode only) | bottom-right |
| gnosari_id | Yes | Agent ID to embed (same identifier used by all other gnosari_* tools) | |
| display_mode | No | Widget layout: bubble (floating button), sidebar (fixed panel), sidebar-push (pushes content), drawer (slides in) | bubble |
| disable_theme | No | Ignore the agent's configured theme and use bare default styling | |
| primary_color | No | Override the agent's theme color with a hex value (e.g. '#667eea') | |
| sidebar_width | No | Custom panel width for sidebar modes (e.g. '420px') | |
| sidebar_position | No | Which side the panel opens from (sidebar/drawer modes only) | right |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | Numeric agent id the snippet was generated for (NOT part of the snippet) | |
| agent_uri | Yes | Public agent URI embedded in the snippet as window.gnosariConfig.agentUri | |
| embed_code | Yes | HTML embed snippet | |
| display_mode | Yes | Widget display mode used |