Package com.composum.sling.nodes.ai
Interface AIService
-
- All Known Implementing Classes:
AIServiceImpl
public interface AIServiceAI related services.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classAIService.AIServiceExceptionSomething went wrong.static classAIService.AIServiceNotAvailableExceptionstatic classAIService.ResponseFormat
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisAvailable()Whether the service is configured.Stringprompt(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
-
-