chat
Send a text prompt to a Grok model and receive its reply. Optionally include session history, system instructions, or multi-agent research with configurable model and agent count.
Instructions
Send a text prompt to a Grok model and return its reply.
Replays prior turns from `chats/{session}.json` when a session is given,
then appends the new user message and saves the round trip.
Args:
prompt: User message to send to the model.
session: Optional session name. Loads and appends history to `chats/{session}.json`.
model: Grok model id (default `grok-4.3`).
system_prompt: Optional system instruction prepended to the conversation.
agent_count: 4 or 16. Only valid with `grok-4.20-multi-agent` for multi-agent research.
Returns:
The assistant's reply text.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | ||
| session | No | ||
| model | No | grok-4.3 | |
| system_prompt | No | ||
| agent_count | No |