Repository navigation
Add recipe: creating an extension that provides an AI engine - #1569
Merged
michaeloffner merged 2 commits intoOct 2, 2026
Merged
Conversation
Explain the admin drivers (built-in drivers, what a driver contains, where it goes in the .lex, how the Administrator writes the ai entry) with a minimal driver for the example engine. The example engine now treats empty custom values as not set, as the Administrator stores empty fields as empty strings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New recipe
docs/recipes/ai-engine-extension.md, explaining how an extension can provide its own AI engine, the same way the S3 extension provides a VFS resource provider.lucee.runtime.ai.*interfaces in the loader (since 7.0.0.114, LDEV-5368), with their signatures, and what Lucee expects from an implementationchat/completionsendpoints, using only the JDK (java.net.http) and the loader API.lex, both as an OSGi bundle and as a Maven artifact (start-bundles: false)aientry (class+bundleName/bundleVersionormaven,custom). There is no manifest key for AI engines.The example code compiles (
javac --release 11 -Xlint:all -Werror) against the 7.0.5.41, 7.1.1.15-RC and 8.0.0.189-SNAPSHOT loaders. It was tested as an installed extension (OSGi and Maven) on 7.1.1.15-RC and 8.0.0.189-SNAPSHOT against a local mock endpoint.Index, README and
lucee.skillregenerated with.github/scripts/generate-index-recipes.js.Possible follow-ups (not changed here):
loader-api-changes-7.mdnamesAICreateSessionandAIChatas functions.aiCreateSessionexists as an alias, but there's noAIChat. The functions arecreateAISession()/inquiryAISession()(aliasesaiCreateSession/aiInquirySession).extension-utilities.mdlists the AI util as "Since: 6.2", butCFMLEngine.getAIUtil()only exists from 7.0. The example also doesn't match the interface: it isList<String> getModelNames(AIEngine)andgetMetaData(AIEngine, boolean, boolean), notgetModelNames(null)returningString[]orgetAIMetadata(pc, name, false).ai.mdmentionsgetAIMetadata()/LuceeGetAIMetadata(); the functions areAIGetMetaData()/LuceeAIGetMetaData().createAISession(name:, systemMessage:)withoutlimit/temperaturepasseslimit=1andtemperature=1to the engine (also with the coreOpenAIEngine), so only the last exchange is kept in the history. 7.1 passes the FLD defaults 50/0.7. This looks related to the defaults being removed from the 8.0 FLD.