luceecreateaisession,aicreatesession()
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,aicreatesession( name=string, systemMessage=string, limit=numeric, temperature=numeric );
Returns: object
| Argument | Description | Default |
|---|---|---|
|
name
string,
required
|
edit
Specifies which AI endpoint configuration to use. Can be provided in two formats:
Alias: aiName, nameAI |
|
|
systemMessage
string,
optional
|
edit
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:
Alias: initalMesssage, message |
|
|
limit
numeric,
optional
|
edit
Maximum number of question-answer pairs to keep in the conversation history. Once reached, older messages will be removed. Consider:
Alias: conversationHistoryLimit |
50 |
|
temperature
numeric,
optional
|
edit
Controls response randomness (0.0 to 1.0). Lower values make responses more focused and deterministic, higher values make them more creative and varied. Recommended settings:
|
0.7 |
Examples
There are currently no examples for this function 33,038ms WARN No examples for function luceecreateaisession,aicreatesessionSee also
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)