Create spreadsheets & documents with Semantic Kernel
Expose document creation to Semantic Kernel as a native plugin function. Decorate a method with @kernel_function and the planner or chat completion can call it to produce a shareable spreadsheet, returning the URL. Works in the Python and .NET SK SDKs.
import requests
from semantic_kernel.functions import kernel_function
class DocsPlugin:
@kernel_function(description="Create a shareable spreadsheet; returns a URL.")
def create_spreadsheet(self, title: str, rows: list) -> str:
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"]
# kernel.add_plugin(DocsPlugin(), plugin_name="docs")How to create a spreadsheet with Semantic Kernel
- 1Create a plugin class with a @kernel_function method.
- 2Inside it, POST to /api/v1/sheets and return the url.
- 3Register the plugin with kernel.add_plugin(...).
- 4Enable auto function calling so the model invokes it when needed.
Why use OpenOfficeAI with Semantic Kernel
- Native SK plugin — discoverable by the planner and chat.
- Works across the Python and .NET SDKs.
- Clear description drives reliable auto-invocation.
Frequently asked questions
How does the model know to call this?
The @kernel_function description and parameter names become the function schema. Enable automatic function calling in your execution settings and the model selects it based on the description.
Can I do this in .NET?
Yes. Decorate a C# method with [KernelFunction], make the HTTP call with HttpClient, and add the plugin to the kernel. The pattern is identical to Python.
Is it compatible with the planner?
Yes. Once registered, the function is available to SK planners, which can chain it with other steps — e.g. gather data, then create the spreadsheet.
Start creating documents with Semantic Kernel
Free tier includes 500 API calls per month — no card required.
Related integrations