Ask an LLM

Provide some reference material to an LLM and then ask it to answer one or more questions.

Ingredient Family: rowActionsIngredients

Outline Display: Prompt an AI given {{referenceData}}
{{prompts}}
{{queryTools}}

Details

By default, queryTools is empty: the LLM answers using only the referenceData you supply and has no access to app tables, the app outline, the current user, or anything else outside the prompt. If the answer needs to be grounded in live app state, populate queryTools. Sane starting points:

  • One Look up in table per table the LLM should read (use rowFilters with currentUser to scope to the signed-in user).
  • App outline so the LLM knows the app’s overall structure.
  • webSearch: true for open-ended factual questions. Insert/update/delete tools and Send email are also available when the LLM should take actions. Any API endpoint wrapped on this app – including endpoints from connected services and custom-defined APIs – can be exposed to the LLM via Call API endpoint or Call list API endpoint.

A queryTools entry may carry roles: (a sibling of its kind:) naming roles the serving handler’s authenticator declares: the model gets that tool only when the user the step runs for holds any of them; for anyone else the tool is absent from what the model sees and unknown to dispatch. Absent means every user the handler admits; [] means nobody.

Local scope

The parent slot binds these (look up the slot in the parent to see how):

  • $table – The table to act on

Settings

Required

  • LLM Connection : API connection (API category: LLM)
    LLM Connection
    Set this to the name of an api: item whose provider: is in the LLM category, or which reaches LLM on 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.

  • referenceData : ingredient slot of llmReferenceIngredients($table) (many)
    The reference material to provide to the LLM

  • prompts : ingredient slot of llmPromptIngredients($table) (many)
    What columns we ask about and the prompts we ask for each one

  • queryTools : ingredient slot of llmQueryToolIngredients (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)