Skip to main content

Configuration

OptionTypeDefaultDescription
enabledbooleantrueDisable the widget without removing the plugin.
buttonLabelstringOpen with AISet the trigger button text.
markdownFilestringindex.mdSet the Markdown filename appended to each docs route.
promptstringRead {url} and answer my questions using it as context.Set the provider prompt. It must contain {url}.
providersProviderOptions[]ChatGPT and ClaudeReplace provider links. Each URL must contain {prompt}.

Custom providers

export default {
plugins: [
[
'docusaurus-plugin-open-with-llm',
{
buttonLabel: 'Ask an LLM',
prompt: 'Use {url} as context, then help me understand it.',
providers: [
{
label: 'Open in ChatGPT',
url: 'https://chatgpt.com/?q={prompt}',
},
{
label: 'Open in Claude',
url: 'https://claude.ai/new?q={prompt}',
},
{
label: 'Open in Perplexity',
url: 'https://www.perplexity.ai/search?q={prompt}',
},
],
},
],
],
};

Set providers to an empty array to keep only the copy, view, and download actions.

Sites with a swizzled docs layout

The plugin automatically wraps DocItem/Layout. If your site already supplies that theme component, import the widget and place it in your wrapper instead:

import OriginalLayout from '@theme-original/DocItem/Layout';
import { OpenWithLlm } from 'docusaurus-plugin-open-with-llm/client';

export default function DocItemLayout(props) {
return (
<>
<OpenWithLlm />
<OriginalLayout {...props} />
</>
);
}

Keep the plugin registered. It supplies the resolved client configuration used by OpenWithLlm.