Create spreadsheets & documents with Groq
Groq runs open models (Llama, etc.) with an OpenAI-compatible API, including tool calling. Define a create_spreadsheet tool and your low-latency Groq agent can generate shareable spreadsheets. The same tools schema you use with OpenAI works here.
Groq (Python, OpenAI-compatible)
from groq import Groq
import requests, json
client = Groq()
tools = [{"type": "function", "function": {
"name": "create_spreadsheet",
"description": "Create a shareable spreadsheet; returns a URL.",
"parameters": {"type": "object", "properties": {
"title": {"type": "string"},
"rows": {"type": "array", "items": {"type": "array"}}},
"required": ["title", "rows"]}}}]
def create_spreadsheet(title, rows):
r = requests.post("https://openofficeai.com/api/v1/sheets",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"title": title, "sheets": [{"rows": rows}]})
return r.json()["url"]How to create a spreadsheet with Groq
- 1Define the tool with the OpenAI-compatible schema.
- 2Pass tools to client.chat.completions.create on a tool-capable Groq model.
- 3Execute the function when the model returns a tool call.
- 4Return the url as a tool message for the final answer.
Why use OpenOfficeAI with Groq
- Very low latency — quick tool round-trips.
- OpenAI-compatible — reuse existing tool definitions.
- Run open models with real document-creation ability.
Frequently asked questions
Which Groq models support tool calling?
Use a tool-capable model such as the Llama 3.x instruct variants. Check Groq's model list for the current tool-use-enabled options before deploying.
Is the integration code different from OpenAI?
Almost identical. Groq mirrors the OpenAI client and tools schema, so you mostly change the client import and base configuration.
Can I stream the response?
Yes. Stream the assistant message, and when a tool call completes, run the function and continue the conversation with the tool result.
Start creating documents with Groq
Free tier includes 500 API calls per month — no card required.
Related integrations