Gemini API plugin based on the model proposed by Ingolf

Hello,
I tested Ingolfschäfer’s plugin compatible OPenAI and tried to create a similar plugin for Google’s Free Gemini API, but with a simpler Python file tm_test_py.py .

To install the plugin and the tm_test_py.py file, follow the instructions given by Ingolf (link below)


I achieved a result that seems pretty good to me: inline and centered formulas are rendered well in TeXmacs. For sentences containing inline formulas, after several attempts, I got something that’s almost good.

Here is the python file to download
https://mon-site-perso-bpascal40.netlify.app/

I’ll show you different examples using the session or using a collapsible environment from the same plugin.


I’m not a real programmer. I used chatgpt a little bit, I and I think I have something interesting that some people could improve. (Obviously, it’s completely adaptable to OpenAI or ollama.)

2 Likes

Dear bpascal, I really like what you have done. One important bit: you should change the file for download, as it contains your personal Gemini API Key. Meaning that anybody could scrape it from there.

In fact, I had not put the right version of the file “Test_Py.py”, I rectified the file to download. The file is actually much shorter and it is the one that gave me the best result in TexMacs.

2 Likes

@bpascal40 Nice work! :+1: If possible, please consider uploading it to tm-forge. Even better, it would be great if you could also explain your work on Notes on TeXmacs.

1 Like