Skip to content

Implemented =PROMPT() function and OpenAI compatible API support#31

Closed
Guard1an wants to merge 3 commits into
balisujohn:masterfrom
MageDoc:master
Closed

Implemented =PROMPT() function and OpenAI compatible API support#31
Guard1an wants to merge 3 commits into
balisujohn:masterfrom
MageDoc:master

Conversation

@Guard1an
Copy link
Copy Markdown
Contributor

@Guard1an Guard1an commented Aug 1, 2025

  • Changed extension name to org.extension.localwriter
  • Implemented =PROMPT() Calc function
    -- Implemented custom IDL for PromptFunction()
    -- Built UNO interface rdb from interface definition idl
  • Implemented OpenAI API support
  • Added Temperature, Seed, API Key configuration settings
  • Added debug log to file "~/libreoffice_prompt_debug.log"

google-labs-jules Bot and others added 3 commits July 21, 2025 11:15
This commit introduces the `PROMPT` function, a new feature for LibreOffice Calc that allows you to leverage the power of Large Language Models (LLMs) directly within your spreadsheets. The `PROMPT` function seamlessly integrates with the existing LocalWriter extension, utilizing the configured settings for the LLM API endpoint, model, and other parameters.

Key features of the `PROMPT` function include:

- **Direct LLM Integration:** You can now call the LLM API from a Calc cell, sending a prompt and receiving the generated text as the cell's value.
- **Flexible Parameters:** The function supports optional parameters for the system prompt, model, and maximum tokens, allowing for fine-tuned control over the LLM's output.
- **Seamless Configuration:** The `PROMPT` function automatically uses the settings from the LocalWriter extension, ensuring a consistent and user-friendly experience.
- **Persistent Results:** The generated text is stored as the cell's value, ensuring that the results are saved with the spreadsheet and are available for export.

This new functionality opens up a wide range of possibilities for you, from generating creative content and summarizing text to performing complex calculations and data analysis.
- Implemented =PROMPT() Calc function
-- Implemented custom IDL for PromptFunction()
-- Built UNO interface rdb from interface definition idl
- Implemented OpenAI API support
- Added Temperature, Seed, API Key configuration settings
- Added debug log to file "~/libreoffice_prompt_debug.log"
Implemented =PROMPT() function and OpenAI compatible API support
@balisujohn
Copy link
Copy Markdown
Owner

Thanks for your interest in localwriter! There is an incoming PR to change the backend to use LiteLLM, which should support OpenAI's API out of the box. The changes from this PR that I am interested in quickly merging are:

  • Changed extension name to org.extension.localwriter
  • Implemented =PROMPT() Calc function
    -- Implemented custom IDL for PromptFunction()
    -- Built UNO interface rdb from interface definition idl

If you have the time I'd appreciate if you could remove the other changes from this PR, and also remove the oxt file and generated RDB file from version control. I will add a linux build process for the rdb file as well as the windows one you provided. When cutting a release, I test for compatibility with Ollama, so that's what I will test the PROMPT() function for compatibility with as well.

@balisujohn
Copy link
Copy Markdown
Owner

After the LiteLLM stuff is merged, I think it will be a good time to revisit adding the controllable temperature and other settings.

@KeithCu
Copy link
Copy Markdown

KeithCu commented Feb 11, 2026

This is a great patch too, can you please review soon so I can build on top of it?

KeithCu referenced this pull request in KeithCu/writeragent Feb 12, 2026
- Add Temperature and Seed settings (from PR #31)
- Add prompt_function.py and =PROMPT() Calc formula
- Resolve conflicts: keep PR #36 unified API/streaming; add temperature/seed
- Fix manifest: remove references to missing CalcAddIn.xcu and pkg-desc
- Fix prompt_function getArgumentName param name

Co-authored-by: Cursor <cursoragent@cursor.com>
@balisujohn
Copy link
Copy Markdown
Owner

merged in #40

@balisujohn balisujohn closed this Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants