Skip to content

About

Demonstrates how to implement a custom Function Server for FirstSpirit AI

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

FirstSpirit Function Server Example Module | Basic Examples

This project demonstrates how to implement a custom Function Server for FirstSpirit AI. A Function Server extends the FirstSpirit AI capabilities by registering custom functions that the AI can invoke autonomously during prompt execution. This enables the AI to access external data sources, execute business logic, or delegate complex computations to your own code. When processing user requests, the AI analyzes available functions and automatically selects and calls the appropriate ones based on their definitions and the context of the request.

This example module illustrates the practical implementation of the GenerativeAIFunctionServerPlugin API. It includes several example functions demonstrating function registration, parameter handling, type mapping, and result formatting. Each example function is annotated with inline documentation explaining key concepts and best practices. Use this module as a starting point for developing your own custom Function Server implementations.

References

Requirements

  • FirstSpirit 2025.11 or newer
  • Java 17
  • Gradle 8.11 or newer

The following Gradle properties must be set in order to build the module. Make sure to add them to the file ~/.gradle/gradle.properties in your local home directory:

artifactory_hosting_username=CLOUD_USERNAME
artifactory_hosting_password=CLOUD_ENCRYPTED_PASSWORD

The encrypted cloud password can be retrieved through a Artifactory REST API call (requires an authenticated session).

Usage

  • Build the module using ./gradlew build and install it in your FirstSpirit server
    • You can find the FSM file under build/fsm/fs-ai-function-server-example-basic-examples-<version>.fsm
  • In the FirstSpirit AI Configuration, define a new prompt.
  • In the configuration dialog for the prompt, allow the functions from this module to be called by simply adding the plugin BasicExamplesFunctionServerPlugin to the list of allowed functions.
  • Execute your prompt operation in the FirstSpirit ContentAssistant to see the results. The FirstSpirit AI will automatically call the function if it is appropriate for the current request.

About

Demonstrates how to implement a custom Function Server for FirstSpirit AI

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages