LuceeCreateAIsession()

This feature is experimental and may be subject to change. If you encounter any issues while using this functionality, please report bugs and errors in our bug tracking system. Creates a new AI session for interaction with Large Language Models (LLMs). The session maintains conversation history and context between interactions. Each session can be configured with different parameters to optimize for specific use cases like code analysis, content generation, or data processing.

Common usage patterns:

  • Exception analysis and debugging assistance
  • Code documentation generation
  • Query optimization suggestions
  • Security review assistance
  • Performance optimization recommendations

The session persists until explicitly terminated or the application restarts.

LuceeCreateAIsession( name=string, systemMessage=string );

Returns: object

Argument Description
name
string, required

Specifies which AI endpoint configuration to use. Can be provided in two formats:

  1. Direct endpoint name: The name of an endpoint as defined in the Lucee Administrator (similar to how datasource names work)
  2. Default reference: Using the format "default:category" to use the endpoint configured as the default for that specific category in the Lucee Administrator.

Currently supported default categories:

  • exception: For exception analysis
  • documentation: For documentation tasks

The endpoint configurations and their default category assignments are managed in the Lucee Administrator.

Alias: aiName, nameAI

systemMessage
string, optional

Initial instruction set that defines the AI's behavior and expertise for this session. This message sets the context and rules for all subsequent interactions.

Best practices:

  • Be specific about the AI's role and expertise
  • Define output format requirements clearly
  • Include any necessary constraints or rules
  • Specify error handling preferences
  • Define response structure expectations

The system message persists throughout the session and influences all responses.

Alias: initalMesssage, message

Examples

There are currently no examples for this function 18,506ms WARN No examples for function luceecreateaisession

See also