<span class="mw-page-title-namespace">Template</span><span class="mw-page-title-separator">:</span><span class="mw-page-title-main">Grok</span>
Fabrice P. Laussy's Web

Documentation

This is a self-contained MediaWiki template that simulates a conversation between a user (default "Human" or a custom name defined by `HumanUserIs`) and Grok, an AI created by xAI. The user input is displayed in a greyish, rounded box flushed to the right, while "Grok's" response is in a lighter box below, featuring a Grok logo with customizable absolute positioning.

Usage

1. Define the user’s name on the page before calling the template:

{{#vardefine:HumanUserIs|Fabrice}}

2. Call the template with no parameters for a default interaction:

{{Grok}}

3. Pass a custom user input (parameter 1) and Grok's response (parameter 2):

{{Grok|How's the weather?|I'm not a weather bot, but I can search the web for you if you'd like! What's your location?}}

Parameters

1 (unnamed) - The user's input (defaults to "Hello, Grok!" if omitted). 2 (unnamed) - Grok's response (defaults to a generic greeting if omitted). HumanUserIs - A variable that, if defined on the page with `#vardefine`, replaces "Human" with the specified name (e.g., "Fabrice"). Falls back to "Human" if undefined.

Notes

- The template uses the font styling: font-size: 1em; font-family: Avantgarde, TeX Gyre Adventor, URW Gothic L, sans-serif;.

- The Grok logo is included in a

with position: absolute inside a relatively positioned container. Upload an image named "Grok_Logo.png" to your MediaWiki instance. The size is set to 20px; adjust as needed.

- The logo positioning differs slightly between the two divs (top-aligned for custom input, bottom-aligned for default). - Requires the Variables extension to define `HumanUserIs` on the page. Use `` to access the variable.

Example

{{#vardefine:HumanUserIs|Fabrice}}
{{Grok|Tell me something cool|Sure, Fabrice! Did you know the universe is expanding?}}

This will display "Fabrice:" instead of "Human:" in the output.