Package com.composum.sling.nodes.ai
Interface AIService
-
- All Known Implementing Classes:
AIServiceImpl
public interface AIService
AI related services.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
AIService.AIServiceException
Something went wrong.static class
AIService.AIServiceNotAvailableException
static class
AIService.ResponseFormat
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isAvailable()
Whether the service is configured.String
prompt(String systemprompt, String prompt, AIService.ResponseFormat responseFormat)
Simplest AI related service: execute a prompt and return the response of the AI.
-
-
-
Method Detail
-
isAvailable
boolean isAvailable()
Whether the service is configured.
-
prompt
@Nonnull String prompt(@Nullable String systemprompt, @Nonnull String prompt, @Nullable AIService.ResponseFormat responseFormat) throws AIService.AIServiceException
Simplest AI related service: execute a prompt and return the response of the AI.- Parameters:
systemprompt
- a system prompt to be used in addition to the promptprompt
- the prompt to be usedresponseFormat
- the format of the response, defaultAIService.ResponseFormat.TEXT
.- Returns:
- the response of the AI
- Throws:
AIService.AIServiceException
-
-