Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/manusapis/Agix/llms.txt

Use this file to discover all available pages before exploring further.

The Chat panel is the central interface for interacting with your spreadsheet data through AI. You type a question or instruction in plain English, Agix reads your sheet, forwards the request to your chosen AI provider, and displays the response directly in the sidebar. From there you can copy the answer, or instruct Agix to write values back into specific cells.

How the Chat Panel works

Every message you send follows a clear path through the ChatPanel component:
1

Enter your prompt

Type a question or instruction into the textarea. The placeholder reads “Ask the AI about your selection…” — any natural language works.
2

Send the request

Clicking Send calls createProvider(config), which returns the correct AI provider implementation (OpenAI, Claude, or a custom endpoint) based on your configured AIProviderConfig.
3

The provider responds

The provider’s chat() method receives a ChatRequest containing your message as a ChatMessage array. The response comes back as a ChatResponse with the AI’s reply in the content field.
4

Result is displayed

The reply string is rendered inside a <pre> element in the panel, preserving any formatting, tables, or bullet lists the model returns.

Types

The chat layer uses two core types from src/types/ai.types.ts:
export interface ChatMessage {
  role: "system" | "user" | "assistant";
  content: string;
}

export interface ChatRequest {
  model: string;
  messages: ChatMessage[];
  temperature?: number;
  maxTokens?: number;
  stream?: boolean;
}
The ChatPanel constructs a single-message array with role: "user" and the current prompt content, then passes it alongside config.defaultModel to provider.chat().

Using the “Use selection” button

Rather than manually typing a cell reference, click Use selection to insert the address of your currently highlighted range directly into the prompt field. Under the hood, this calls:
excelService.getSelectedRange().then((r) => setPrompt(r.address));
getSelectedRange() uses the Office.js Excel API to load the address, values, rowCount, and columnCount of the active selection, then returns a RangeSelection object. Only the address string is placed into the prompt — combine it with a question to give the AI precise context.

Example prompts

The following prompts illustrate the range of tasks you can run from the Chat panel:

Data summarisation

"Summarize the data in A1:D50 — what are the key trends?"

Ranking and filtering

"Which rows in B2:B200 have the highest revenue? List the top 10."

Translation

"Translate all values in column B to Spanish and list them in order."

Calculation

"Calculate the month-over-month growth rate for each row in C2:C13."

Anomaly spotting

"Are there any outliers in the sales figures in D2:D500?"

Rewriting

"Rewrite the customer notes in column F to be more concise."

Writing results back to the sheet

After the AI responds, you have two options:
  1. Copy manually — select the text in the <pre> output and paste it wherever you need it.
  2. Instruct Agix to write — follow up with a prompt such as “Write those values into column E starting at E2”. Agix will call excelService.writeValues() with the parsed result and the target start address.
// excelService.writeValues writes a 2-D array to the sheet
await excelService.writeValues(
  [["January", 12400], ["February", 15300]],
  "E2"
);
// Returns: { address: "Sheet1!E2:F3", rowsWritten: 2, columnsWritten: 2 }
Be specific about cell ranges in your prompt. Instead of “summarize my data”, write “summarize the data in A1:F200”. Explicit ranges give the AI the exact rows and columns it needs to reason about, which produces more accurate and actionable responses.
While a request is in flight the Send button is disabled and its label changes to “Working…”. This busy state is enforced in the component: if (!prompt.trim() || busy) return;. It prevents duplicate submissions if you click quickly or press the button while the previous response is still streaming.

Build docs developers (and LLMs) love