Is there an already existing way, or upcoming API, which allows extension developers to call local LLM (ex: ollama http://localhost:11434) from their extension's lua scripts in order to integrate ai features into FG?
Printable View
Is there an already existing way, or upcoming API, which allows extension developers to call local LLM (ex: ollama http://localhost:11434) from their extension's lua scripts in order to integrate ai features into FG?
You could use the Interface.openURL API functions: https://fantasygroundsunity.atlassia...erface#openURL The LLM URL would need to generate an appropriate response which would then need to be parsed back into FG appropriately - there are Utility API functions to decode CSV, JSON and XML: https://fantasygroundsunity.atlassia...998353/Utility
As an example, look at how the Syrinscape integration calls a URL to get a CSV response of the available Syrinscape sounds - look in scripts\manager_sound_syrinscape.lua in the CoreRPG ruleset, start looking at "Interface.openURL" in the onButtonImportWeb function.
If that method won't work, then you may need to look at generating a text, CSV, JSON or XML document outside of FG and then writing code that uses the File.openTextFile function: https://fantasygroundsunity.atlassia...e#openTextFile to load the data into FG and then use a Utility function to read the data and process appropriately. Note that File.openTextFile may only fully operate on files within the FG Data Directory structure.
Thanks!