createAISession

Creates a session for talking to a configured AI endpoint. The session keeps the conversation history between calls. aiCreateSession() is an alias. Lucee 6.2 names it luceeCreateAISession(), which Lucee 7 still accepts.

createAISession(name [, systemMessage] [, limit] [, temperature]) → returns any

This function requires Lucee 7 and up.  Not supported on Adobe ColdFusion, etc.

Argument Reference

name string
Required

The endpoint name from the Lucee Administrator, or a default:category reference.

systemMessage string

Instructions that set the AI's role and rules for the whole session.

limit numeric
Default: 50

The maximum number of question and answer pairs to keep in the history. Older ones are dropped.

temperature numeric
Default: 0.7

How random the responses are, from 0.0 (focused) to 1.0 (creative).

Examples
Sample code invoking the createAISession function

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub