FirstSpirit AI
Table of contents |
FirstSpirit AI API
The FirstSpirit AI API provides a way to integrate generative AI technologies into FirstSpirit.
GenerativeAIAgent
Access to the API is through the SpecialistBroker and a GenerativeAIAgent.
Simple example:
import de.espirit.firstspirit.ai.GenerativeAIAgent;
import de.espirit.firstspirit.ai.dto.*;
GenerativeAIAgent ai = context.requireSpecialist(GenerativeAIAgent.TYPE);
Optional<String> idea = ai.request("Generate an idea for a new article");
GenerativeAIConnectorPlugin
The connection to the FirstSpirit AI API is established via the "GenerativeAIConnectorPlugin" plugin. This plugin can be implemented as a module and thus represents the link to an external Generative AI API.
Configuration: Standard Plugin
The standard plugin can be selected in the FirstSpirit AI Configuration Service.
OpenAI Connector Module
The OpenAI connector module is automatically installed with FirstSpirit.
Configuration: Endpoint
Provide information for API Key and API URL.
Optional configuration parameters:
- Model: the designation of the model
- API Key Request Header: parameter for supporting Microsoft-specific authentication. If not otherwise defined, the value is pre-filled based on "azure.com" (api-key) and "openai.com" (empty = default "Authentication").
Using the "Test Connection" button, the configuration can be checked.