Implemented =PROMPT() function and OpenAI compatible API support#31
Implemented =PROMPT() function and OpenAI compatible API support#31Guard1an wants to merge 3 commits into
Conversation
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
|
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:
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. |
|
After the LiteLLM stuff is merged, I think it will be a good time to revisit adding the controllable temperature and other settings. |
|
This is a great patch too, can you please review soon so I can build on top of it? |
- 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>
|
merged in #40 |
-- Implemented custom IDL for PromptFunction()
-- Built UNO interface rdb from interface definition idl