Package de.espirit.firstspirit.ai
Interface GenerativeAIFunctionServer
- All Superinterfaces:
AutoCloseable
,Closeable
Plugin to integrate external functions into generative AI requests.
- Since:
- 5.2.251104
-
Method Summary
Modifier and TypeMethodDescriptionReturns a list of available functions.@NotNull String
getName()
Returns the name of the function server, which is used for identification of the server as well as a prefix for the identification of functions from different servers when performing AI requests.@Nullable Serializable
perform
(@NotNull GenerativeAIFunctionServerCall call) Implementation of a previously specifiedFunction
.
-
Method Details
-
getName
Returns the name of the function server, which is used for identification of the server as well as a prefix for the identification of functions from different servers when performing AI requests.- Returns:
- The name of the function server.
- Since:
- 5.2.251104
-
getFunctions
Returns a list of available functions.- Returns:
- The available functions.
- Since:
- 5.2.251104
-
perform
@Nullable @Nullable Serializable perform(@NotNull @NotNull GenerativeAIFunctionServerCall call) throws IOException Implementation of a previously specifiedFunction
. The AI expects the function to return aString
, even if the result is a JSON object. For convenience the API will try to convert the returned object to an appropriate JSON string type, which may not be supported for some complex Java object types.- Parameters:
call
- The function call context.- Returns:
- The result object of the function call.
- Throws:
IOException
- If the call failed for some reason.- Since:
- 5.2.251104
-