Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Extending Exponential Intelligence

Extend expai from your own extension - a field action by settings, a tool the assistant can call (expAiTool), a provider for another AI service (expAiProvider), panel sections, JavaScript hooks and the registries the…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/creators/app-creators/extending-exponential-intelligence.md

On this page

Extending Exponential Intelligence

This page is for application creators who add to Exponential Intelligence without changing it: everything is added from your own extension, by settings and small classes. Source: extension/expai/doc/extending.md, whose examples were run for expai 0.0.1.0; its example extension is in extension/expai/doc/examples/expaiexample.

Exponential Intelligence, Models: the models each provider offers, which is the default, and what each may do
Exponential Intelligence, Models: the models each provider offers, which is the default, and what each may do

Contents

  1. Your extension
  2. A field action, by settings only
  3. A tool the assistant can call
  4. A provider
  5. Panel sections and JavaScript hooks
  6. Checking your additions

Your extension

extension/myai/
    settings/expai.ini.append.php      what you add to expai's lists
    settings/design.ini.append.php     DesignExtensions[], BackendJavaScriptList[] (optional)
    classes/...                        tools, field action handlers, a provider
    design/admin/templates/...         panel or edit form sections

Activate it where expai is active, regenerate autoloads, clear the INI and template caches (including ezjscore-packer and template-block), and restart Velocity.

A field action, by settings only

# settings/expai.ini.append.php
[EditViewSettings]
FieldActions[]=headline

[FieldAction_headline]
Label=Headline
Handler=expAiPromptFieldAction
Datatypes[]
Datatypes[]=ezstring
Input=none
Instruction=Write a short, catchy headline (at most eight words) for this content, based on its other fields.

Input is none, instruction, optional_instruction or language.

A tool the assistant can call

[ToolSettings]
Tools[]=count_children

[Tool_count_children]
Class=myAiToolCountChildren

The class extends expAiTool with description(), inputSchema(), execute( array $input, expAiToolContext $context ), stepText() and stepArguments(). Rules from the expai documentation:

  • Read and write through $context->reader and $context->writer, which run as the current user with its checks.
  • A writing tool returns true from writes(), checks $context->checkDraftLimit(), records drafts with expAiDraftLog::record() and never publishes.
  • Throw expAiException for errors the model should hear.
  • New tools are offered in new conversations.

A read service of expservices marked 'ai' => true becomes a tool without a class (Backend ezjscore services).

A provider

An OpenAI-compatible or Anthropic-compatible server needs no code: a [Provider_<id>] group with Type=openai_chat (or anthropic) and model groups. Anything else: a class implementing expAiProvider (or extending expAiProviderBase) with providerId(), modelName() and send( array $request ), which translates expai's internal Messages-API shape to the service and back. Add the models to the [Pricing] table so costs are known.

Panel sections and JavaScript hooks

Panel and edit form sections are templates your extension adds to expai's lists; JavaScript hooks are script files in your design's backend script list. Follow sections 3 and 4 of extension/expai/doc/extending.md, and keep to the admin rules: no inline scripts or styles (Content Security Policy for your code).

Checking your additions

expai declares registries in settings/rad.ini.append.php; Setup > RAD > Extension point survey (setup/radsurvey/(show)/registries) counts your providers, tools and field actions and shows any whose class, template or block is missing (RAD extension surface).

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x