luceeinquiryaisession,aiinquirysession()
Sends a question/message to an AI session and returns the response. The function maintains conversation context from previous interactions within the same session. The response can either be returned as a complete string or streamed in chunks to a listener function for real-time processing.
luceeinquiryaisession,aiinquirysession( session=any, question=any, listener=function );
Returns: String
| Argument | Description |
|---|---|
|
session
any,
required
|
edit
The AI session object returned by LuceeCreateAISession(). This session maintains the conversation history and configuration settings like temperature and system message. Alias: aiSession |
|
question
any,
required
|
edit
The question or message to send to the AI. Can be:
Alias: message, parts |
|
listener
function,
optional
|
edit
A user-defined function that receives the response in chunks as they arrive from the AI. This enables real-time processing or display of the response. The listener function should accept a single argument which will contain the response chunk. When a listener is provided, the function still returns the complete response as a string, but also streams each chunk to the listener as it arrives. |
Examples
There are currently no examples for this function 33,043ms WARN No examples for function luceeinquiryaisession,aiinquirysessionSee also
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)