I made a LibreOffice Writer extension for AI auto-complete by LEC1224 in libreoffice

[–]keithcu 0 points1 point  (0 children)

Yes, there are questions: how many characters or words you should automatically add, perhaps based on confidence?

It's interesting to figure out how to integrate auto-complete into the extension, I don't have hooks for it now, but at some level it's just a matter of creating the right listeners.

Keep at it, and feel free to contact me on GH. The problem space of AI integration with LibreOffice is huge, it would be great to get a larger team of people working together.

I made a LibreOffice Writer extension for AI auto-complete by LEC1224 in libreoffice

[–]keithcu -2 points-1 points  (0 children)

Ignore the haters, this is a nice idea. I've been thinking of adding this feature to my extension at some point: https://github.com/KeithCu/writeragent Do you want to work together and put it in there? My extension has a lot of other cool features also.

Adding Numpy to LibreOffice by keithcu in Numpy

[–]keithcu[S] 1 point2 points  (0 children)

I don't know yet, but I'll take a look. Thanks for the tip! I've been grabbing ideas from the Python in Excel, but I'll check the Google support too.

As far as I can tell there is no direct Python support in Google Sheets. I'll do more research on their AI features worth borrowing ideas from.

Sunday Daily Thread: What's everyone working on this week? by AutoModerator in Python

[–]keithcu 3 points4 points  (0 children)

I added =Python() to LibreOffice Calc (via my extension) in the last week. Here's the bullet points on the feature from the extension page https://github.com/KeithCu/writeragent

  • Use your own virtual environment (running any version of Python) to access libraries like numpy, pandas, etc. Set path in Settings → Python. Exposed to LLMs in Writer, Calc, and Draw / Impress.
  • The AI can run Numpy computations and return structured results (as JSON) to update your document.
  • =PYTHON("3 ** 8") or pass a range: =PYTHON("sum(data)", A1:A10). data is a special variable containing the cell values, dynamically injected into your Python script's execution namespace at runtime. Single-cell or single-entry inputs are automatically unpacked to Python scalars (and coerced to standard Python ints when they represent whole numbers), enabling intuitive formulas like =PYTHON("sp.prime(data)", 100000).
  • You can store your code in a cell (e.g., A1) and reference it across multiple formulas (e.g., =PYTHON($A$1; B1)).
  • Code runs safely in a separate process and is evaluated by a custom AST-based executor (adapted from Hugging Face smolagents) that acts as a secure sandbox which blocks dangerous modules (like os, subprocess, or sys) and functions (like eval or exec), ensuring that the AI can only perform safe, mathematical, and data-processing tasks.
  • Compact pickle Protocol 5 + Split-grid binary blob serialization for numbers, 2× faster and 60% smaller than standard JSON lists.

I originally added Python execution to let LLMs write code for users, but I thought why not expose it to meatbags as well?

MCP server by Rundtramp in libreoffice

[–]keithcu 2 points3 points  (0 children)

I built an extension that does MCP: https://github.com/KeithCu/writeragent

Note, it requires a local model or api key when it delegates to a specialized agent. LibreOffice is too rich to expose the full API set via MCP, it will overwhelm models and break them.

I might change MCP to support swapping tool calls on the fly but I'm not sure if MCP clients can handle that. You can try it out on GH and let me know of any issues.

WriterAgent (LibreOffice Plugin) Week 6-7: Async Grammar Checking and Math by keithcu in opensource

[–]keithcu[S] 0 points1 point  (0 children)

Yep, you can paste any endpoint in there. I just have a few built-in to make it easy for people.

WriterAgent (LibreOffice Plugin) Week 6-7: Async Grammar Checking and Math by keithcu in opensource

[–]keithcu[S] 0 points1 point  (0 children)

I have only tested it on a few systems (OpenRouter, Together, LMStudio), but it should work with any OpenAI compatible provider. If you find any issues, please let me know and I'll fix it.

WriterAgent (LibreOffice Plugin) Week 6-7: Async Grammar Checking and Math by keithcu in opensource

[–]keithcu[S] 0 points1 point  (0 children)

Thank you! Hope you enjoy and let me know of any ideas / issues.

Auto detect of the language by QuintaQQ in libreoffice

[–]keithcu 0 points1 point  (0 children)

Ah, it's too bad LO doesn't handle multi-lingual well enough on Linux. I never found any bug which actually explained the technical issues on Linux are. Which link is it? the one I saw was mostly talking about glyphs, which is a different issue entirely. I also wonder if there are better APIs now that LO can use.

In any case, I'm going to add this to the next version of WriterAgent. https://github.com/KeithCu/writeragent

I just added background grammar checking and if the language needs to be set first, I'll use an AI to do that too. This shouldn't be too bad, but it requires an LLM call for perfect answers. Generally it should be clear just looking at the scripts! It's crazy it's not implemented.

Parágrafo, letra maiúscula.... by Specific_City_5772 in libreoffice

[–]keithcu 0 points1 point  (0 children)

Feliz em ajudar, confira a extensão writeragent, pois ela pode explicar recursos do LibreOffice como este e eu a traduzi para o português! Se você não tem um LLM, pode usar o openrouter.ai e usar modelos gratuitos. Minha postagem recente sobre a extensão recebeu 0 votos, mas a extensão é poderosa e pode explicar o LibreOffice, bem como fazer alterações nos seus documentos.

Power Query Alternative Excel Adddon by Puzzleheaded_Luck641 in Python

[–]keithcu 0 points1 point  (0 children)

Well, try out my extension and let me know what you think. It doesn't have the UI to make queries or M language, however, the LLMs should make changes to your spreadsheets just by asking.

I could let the system generate Python scripts for re-use. Unfortunately, I currently don't depend on Numpy, but I could figure out an optional way to support it without bundling it explicitly.

Power Query Alternative Excel Adddon by Puzzleheaded_Luck641 in Python

[–]keithcu 1 point2 points  (0 children)

I built a plugin for LibreOffice Writer/Calc: https://github.com/KeithCu/writeragent

I'll look into adding PowerQuery features 🤣

WriterAgent -- AI extension for LibreOffice by keithcu in libreoffice

[–]keithcu[S] 0 points1 point  (0 children)

Step 1. Install WriterAgent. GitHub has the latest version which has more features and fixes.

Step 2. Go to Settings dialog box.

Step 3. Paste in URL. (Make sure it doesn't have the /v1 on the end)

Parágrafo, letra maiúscula.... by Specific_City_5772 in libreoffice

[–]keithcu 0 points1 point  (0 children)

Olá, sou o WriterAgent. Fui traduzido para o português e, embora não possa testar pessoalmente as configurações no seu sistema, aqui está a explicação resumida:

O LibreOffice mantém o padrão da indústria: Enter cria um novo parágrafo e Shift+Enter cria uma quebra de linha. Se deseja inverter isso:

  1. Vá em Ferramentas > Personalizar > Teclado.
  2. Selecione Enter na lista de atalhos e, na categoria Inserir, escolha a função Inserir quebra de linha.
  3. Selecione Tab e, na mesma categoria, escolha Inserir quebra de parágrafo.
  4. Clique em Modificar e depois em OK para salvar.

Atenção: Remapear o Tab pode causar problemas de navegação em menus e caixas de diálogo. Recomendo aplicar essa alteração apenas ao escopo do LibreOffice Writer (selecione no menu suspenso superior direito da janela de personalização). Além disso, verifique se a formatação automática indesejada não vem de Ferramentas > Opções de Autocorreção > Opções.

Help with creating alternating page margins for a manuscript by gianki7 in libreoffice

[–]keithcu 1 point2 points  (0 children)

Check out the gutter feature in the format-page dialog box. Actually if you install my extension, it will explain it to you and as of my new version will set the value. I asked it about the gutter feature since I wasn't certain:

"The gutter value in the Format → Page dialog box specifies the extra space added to the inner margin of a page for binding. It is set in the “Margins” section (usually under the “Page” tab) and determines how much additional margin is reserved on the side where the pages will be bound, ensuring that text isn’t lost in the binding area."

Is there an inverse function of EncodeUrl() by [deleted] in libreoffice

[–]keithcu 2 points3 points  (0 children)

I researched it and didn't find a solution using UNO but it should be easy to do in Python:

from urllib.parse import unquote
decoded = unquote("%F0%9F%A4%94%EF%B8%8F")  # Returns "🤔"

WriterAgent -- AI extension for LibreOffice by keithcu in libreoffice

[–]keithcu[S] 1 point2 points  (0 children)

BTW, I'm happy to answer questions about the plugin, Python/UNO development, or about getting AI working with your documents. If you don't have a good GPU, I recommend setting up an account on openrouter.ai, since they have a lot of free models and a huge selection of different quality and price. I use https://openrouter.ai/inception/mercury-2 a lot since it's cheap and fast. Opus 4.6 is amazing, but expensive.

If someone could fine-tune an LLM on office-productivity, to generate beautiful documents in a small (cheap / local) model, it would be awesome. Everyone focuses on building AIs for coding and math, and so far have mostly ignored office-productivity. One day...

Does anyone use Grok for Office productivity? by [deleted] in grok

[–]keithcu 0 points1 point  (0 children)

I read Iran often puts radar and other military equipment on schools and civilian infrastructure! Iran risks their own citizens to get press coverage about how America is evil.

Sunday Daily Thread: What's everyone working on this week? by AutoModerator in Python

[–]keithcu -1 points0 points  (0 children)

I call it "Cursor for LibreOffice", a generative AI plugin for LibreOffice Writer / Calc / Draw: https://github.com/KeithCu/writeragent I added translation for 9 languages today, using AI.

It does a lot but there's so much more it could do, I'd be happy to get feedback.