Fantasy Grounds Merchandise

Thread: Local LLM hook

  1. #1

    Local LLM hook

    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?

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    34,686
    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.
    FG Wiki: How to Compile the FG Logs

    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  3. #3
    Quote Originally Posted by Trenloe View Post
    You could use the Interface.openURL API function
    Looks like Interface.openURL is for http GET. Any other option allowing http POST ? This is what would be needed in this case.

  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    34,686
    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.
    FG Wiki: How to Compile the FG Logs

    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  5. #5

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Refer a Friend

Log in

Log in