Package com.sap.ai.sdk.orchestration
Class LocalPromptTemplate
java.lang.Object
com.sap.ai.sdk.orchestration.PromptTemplate
com.sap.ai.sdk.orchestration.LocalPromptTemplate
A template to use in
OrchestrationModuleConfig.- Since:
- 1.4.0
-
Nested Class Summary
Nested classes/interfaces inherited from class com.sap.ai.sdk.orchestration.PromptTemplate
PromptTemplate.ReferenceBuilder, PromptTemplate.ReferenceBuilder1, PromptTemplate.ReferenceBuilder2, PromptTemplate.ReferenceBuilder3 -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanGet the placeholder values supplied for this template.Get the message history to prepend to the conversation for this template.getTools()inthashCode()protected PromptTemplatingModuleConfigPromptCreate a low-level representation of the template.toString()withDefaults(Map<String, String> defaults) withInputParameters(Map<String, String> inputParameters) Set the response format to JSON object.Set the response format to the given JSON schema.withMessageHistory(List<Message> messageHistory) withMessages(Message message, Message... moreMessages) Create a new template with the given messages.withTools(List<ChatCompletionTool> tools)
-
Method Details
-
withMessages
@Nonnull public LocalPromptTemplate withMessages(@Nonnull Message message, @Nonnull Message... moreMessages) Create a new template with the given messages.- Parameters:
message- the first message to use in the template.moreMessages- additional messages to use in the template.- Returns:
- the updated template.
-
toLowLevel
Create a low-level representation of the template.- Specified by:
toLowLevelin classPromptTemplate- Returns:
- the low-level representation of the template.
-
withJsonSchemaResponse
Set the response format to the given JSON schema.- Parameters:
schema- the JSON schema to use.- Returns:
- the updated template.
-
withJsonResponse
Set the response format to JSON object.- Returns:
- the updated template.
-
getChatMessages
-
getMessageHistory
Description copied from class:PromptTemplateGet the message history to prepend to the conversation for this template.- Specified by:
getMessageHistoryin classPromptTemplate- Returns:
- the message history for this template.
-
getInputParameters
Description copied from class:PromptTemplateGet the placeholder values supplied for this template.- Specified by:
getInputParametersin classPromptTemplate- Returns:
- the placeholder values supplied for this template.
-
getDefaults
-
getResponseFormat
-
getTools
-
toString
-
equals
- Overrides:
equalsin classPromptTemplate
-
canEqual
- Overrides:
canEqualin classPromptTemplate
-
hashCode
public int hashCode()- Overrides:
hashCodein classPromptTemplate
-
withMessageHistory
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withInputParameters
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withDefaults
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withTools
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-