Connect an LLM to a live Office document
Editor AI SDK cannot run without Editor SDK. It is an extension, not a standalone SDK. Your application must first open and control the document through Editor SDK. Editor AI SDK then exposes those Editor SDK operations as structured tools for an LLM.
Editor AI SDK connects Editor SDK document tools to your AI Agent: an LLM chooses structured Editor SDK tools, the host application validates those calls, and Editor SDK applies them to the Word, Spreadsheet, or Presentation document.
Editor AI SDK is published on npm as @thinkfree.dev/tfo-ai-sdk. It remains in Preview and requires Editor SDK (@thinkfree.dev/tfo-sdk). Use bridgeToolsViaSdk() to register document tools with your AI Agent integration. Your application supplies the model connection, tool-calling loop, and chat UI.
The model receives the prompts, conversation history, tool names, descriptions, JSON schemas, and tool results that your application sends. Including document-read results in the conversation also sends document content to the model provider. Your application controls the data sent, authorization, user approval, execution limits, and audit.
How the pieces fit
| Piece | Provided by | What it does |
|---|---|---|
| Document tools | Editor SDK - app.getTools() | Returns the editor's tool catalog as executable objects (name, description, inputSchema, execute) |
| Module prompt | Editor SDK - app.getSystemPrompt() | Optional system prompt describing the document model and API conventions of the open module |
| Tool loop and chat UI | Your application | Sends schemas to the model, validates each tool call, executes approved tools, returns results |
| Provider connection | Your application or relay | Direct provider call for local experiments; a trusted relay for shared deployments |
What you can try today
| Capability | Status | Where to verify it |
|---|---|---|
| Word, Spreadsheet, and Presentation tool discovery | Available | Editor AI SDK Playground |
| Direct Anthropic, OpenAI, and Gemini connection | Development only | Playground provider settings |
| Server relay connection | Available as an integration pattern | Playground and relay configuration guide |
| Tool-call loop that edits a live document | Available | Playground |
| Approval UI, tenant policy, and production audit service | Application responsibility | Safety guide |
| Editor AI SDK npm package | Public Preview | npm package |
Recommended architecture
For a local experiment, the browser can call a provider directly. For a shared or production service, use a relay so the provider credential never reaches browser JavaScript.
Start with the quickstart, then set up the relay server and apply the safety checklist.
Open the Editor AI SDK Playground