Chat
An AI chat panel that can only be attached to a handler’s chat field; it is not a reusable tab-segment module
Placement
Chat placement: a module with this concept may only be referenced from a handler’s chat: slot. Placing it in a tab segment is a type error. A type: page handler renders it as a slide-out panel; a type: chat handler renders it as the whole page.
Outline Display: Chat with an AI assistant using {{queryTools}}
Details
A module with this concept can only be referenced from a handler’s chat: slot. Referencing it from a tab segment is a type error.
Maintains persistent message history in the database, storing each message with its author (User or Assistant), content, and timestamp. Supports LLM tool use during reasoning, including database table lookups, email sending, and web search. The maximum number of tool call rounds is configurable; the model comes from the chosen LLM connection (a model service setting, or the provider’s default). Users can reset the conversation history.
By default, queryTools is empty: the assistant has no access to app tables, the app outline, or the current user, and answers as a generic chatbot. Make the chat useful by populating queryTools. Sane starting points:
- One
Look up in tableper table the LLM should be able to read (userowFilterswithcurrentUserto scope to the signed-in user). App outlineso the LLM understands the app’s structure (tables, pages, modules).webSearch: truefor open-ended factual questions. Add insert/update/delete tools orSend emailwhen the assistant should take actions, not just answer questions. Any API endpoint wrapped on this app – including endpoints from connected services and custom-defined APIs – can also be exposed to the LLM viaCall API endpointorCall list API endpoint.
A queryTools entry may carry roles: (a sibling of its kind:) naming roles the handler’s authenticator declares: only a signed-in user holding any of them gets that tool – for anyone else the model never sees its definition and dispatch treats it as unknown. Absent means every signed-in user; [] means nobody.
Settings
Required
LLM Connection: API connection (API category:LLM)
LLM Connection
Set this to thenameof anapi:item whoseprovider:is in theLLMcategory, or which reachesLLMon another category’s behalf – a brokered api counts when its own settings point it at that service, and its provider page says which setting decides. Do not set it to a service name; pick the API the service points at.
Optional
-
webSearch: constant value (type: bool; required, non-nullable)
Let the model use its provider’s native web search during reasoning, for open-ended factual questions no app table can answer. Requires a provider that supports web search. -
queryTools: ingredient slot ofllmQueryToolIngredients(many)
Database tables the LLM can query during its reasoning -
maxToolCalls: constant value (type: integer; required, non-nullable)
Maximum number of tool call rounds the LLM can make (usually omit this parameter)