Skip to content

Q2 agent

A powerful, customizable chat library that brings AI-driven code generation and assistance to your apps and docs—enabling your users to interact with your APIs directly and bypass traditional documentation.

"Q2 walkthrough"

  1. Option selector: For any given API library, methods refer to the available endpoints, while workflows represent a list of predefined or commonly used sequences defined by the library owner. Clicking each tab displays the corresponding items below.
  2. Language selector: When a language is selected, code is generated in that language. If no language is selected, code is generated in Python by default.
  3. Method/Workflow search: Search for a particular item in the list
  4. Custom prompt: Use custom prompts to create your own workflows in any programming language. You can also ask about the steps involved in a workflow or request input/output details for any endpoint.

Customizations

Here are the options that can be passed along with the Swytchcode chat component

Props

PropTypeDefaultDescription
apiKeystringundefinedYour Swytchcode API key (required)
borderColorstring’#e5e7eb’Color of the library border
heightstring | number’80vh’Height of the library
widthstring | number’100%‘Width of the library
initialMessagestring’Hello! How can I help you today?‘Initial message displayed in the chat
sendButtonColorstring’#2563eb’Color of the send button
userBubbleColorstring’#3b82f6’Color of user message bubbles
promptValuestring’Ask me for code for any API method or full workflow…’Placeholder text for the input field
highlightThemestring’twilight’Theme for code syntax highlighting

Available Themes

The highlightTheme prop supports the following themes:

ThemeDescription
defaultClean and minimal theme with a light background
darkDark theme with high contrast
funkyVibrant theme with a dark background and colorful syntax
okaidiaDark theme with a warm color palette
twilightDark theme with a cool color palette (default)
coyLight theme with subtle colors
solarizedlightLight theme based on the Solarized color scheme
tomorrowDark theme with a modern color palette
atom-darkDark theme inspired by Atom editor
vsLight theme inspired by Visual Studio
xonokaiDark theme with a warm, earthy color palette
duotone-darkDark theme with a duotone color scheme
duotone-lightLight theme with a duotone color scheme
duotone-seaDark theme with a sea-inspired duotone scheme
duotone-spaceDark theme with a space-inspired duotone scheme
duotone-earthDark theme with an earth-inspired duotone scheme
duotone-forestDark theme with a forest-inspired duotone scheme
duotone-roseDark theme with a rose-inspired duotone scheme