Background for Skyrim SE

The POW_functions Script

    The POW_functions script is a part of Skyrim SE’s Papyrus scripting ecosystem. This script is not present in the vanilla game, but can be found in modded sources like Papyrus Ollama Wrapper (Ollama Wrapper).

    For this script, the Papyrus index knows about:

    • 3 functions


    Inheritance Tree

    No indexed scripts extend this script.

    Properties

    No properties found.

      Events

        No events found.

      Functions

      • intfunctionOllamaGenerate(stringmodel="", stringprompt, intmaxLineWidth=0)NativeGlobal

        Starts an asynchronous AI generation request that runs in the background
        Configuration is auto-detected based on calling script name:

        • If script is "MyMod_BookGen", looks for "Data/SKSE/Plugins/MyMod_POW.toml"
        • Falls back to POW.toml if no mod-specific config exists

        Parameters:
        model - Ollama model name (e.g. "llama3:8b"). If empty, uses model from config file
        prompt - Input text for generation
        maxLineWidth - Characters per line for text wrapping (default = 0 (no wrap), 20 fits properly in vanilla books)

        Returns callback ID to track this specific request

      • boolfunctionIsGenerationComplete(intcallbackId)NativeGlobal

        Non-blocking poll to check if a specific generation request has completed
        Allows scripts to query status without freezing execution

        Parameters:
        callbackId - The ID returned by OllamaGenerate()

        Returns true when generation is done and result is ready

      • stringfunctionGetGenerationResult(intcallbackId)NativeGlobal

        Retrieves the completed generation result and automatically cleans up storage

        Parameters:
        callbackId - The ID returned by OllamaGenerate()

        Returns the generated text, or error message if generation failed

      Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.