Class PromptTemplatesApi
- Direct Known Subclasses:
PromptClient
Prompt Storage service for Design time invalid input: '&' Runtime prompt templates.
-
Field Summary
Fields inherited from class com.sap.cloud.sdk.services.openapi.apache.apiclient.BaseApi
apiClient, defaultHeaders -
Constructor Summary
ConstructorsConstructorDescriptionPromptTemplatesApi(com.sap.cloud.sdk.cloudplatform.connectivity.Destination httpDestination) Instantiates this API class to invoke operations on the Prompt Registry API.PromptTemplatesApi(com.sap.cloud.sdk.services.openapi.apache.apiclient.ApiClient apiClient) Instantiates this API class to invoke operations on the Prompt Registry API based on a givenApiClient. -
Method Summary
Modifier and TypeMethodDescriptioncreateUpdatePromptTemplate(PromptTemplatePostRequest promptTemplatePostRequest) Create or update a prompt templatecreateUpdatePromptTemplate(PromptTemplatePostRequest promptTemplatePostRequest, String aiResourceGroup, String aiResourceGroupScope) Create or update a prompt templatedeletePromptTemplate(UUID promptTemplateId) Delete prompt templatedeletePromptTemplate(UUID promptTemplateId, String aiResourceGroup, String aiResourceGroupScope) Delete prompt templatebyte[]exportPromptTemplate(UUID promptTemplateId) Export prompt templatebyte[]exportPromptTemplate(UUID promptTemplateId, String aiResourceGroup, String aiResourceGroupScope) Export prompt templategetPromptTemplateByUuid(UUID promptTemplateId) Get prompt template by UUIDgetPromptTemplateByUuid(UUID promptTemplateId, String aiResourceGroup, String aiResourceGroupScope) Get prompt template by UUIDImport prompt templateimportPromptTemplate(String aiResourceGroup, String aiResourceGroupScope, File _file) Import prompt templatelistPromptTemplateHistory(String scenario, String version, String name) List prompt template historylistPromptTemplateHistory(String scenario, String version, String name, String aiResourceGroup, String aiResourceGroupScope) List prompt template historyList prompt templateslistPromptTemplates(String aiResourceGroup, String aiResourceGroupScope, String scenario, String name, String version, String retrieve, Boolean includeSpec) List prompt templatesparsePromptTemplateById(UUID promptTemplateId) Parse prompt template by IDparsePromptTemplateById(UUID promptTemplateId, String aiResourceGroup, String aiResourceGroupScope, Boolean metadata, PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest) Parse prompt template by IDparsePromptTemplateByNameVersion(String scenario, String version, String name) Parse prompt template by name and versionparsePromptTemplateByNameVersion(String scenario, String version, String name, String aiResourceGroup, String aiResourceGroupScope, Boolean metadata, PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest) Parse prompt template by name and versionwithDefaultHeaders(Map<String, String> defaultHeaders) Creates a new API instance with additional default headers.
-
Constructor Details
-
PromptTemplatesApi
public PromptTemplatesApi(@Nonnull com.sap.cloud.sdk.cloudplatform.connectivity.Destination httpDestination) Instantiates this API class to invoke operations on the Prompt Registry API.- Parameters:
httpDestination- The destination that API should be used with
-
PromptTemplatesApi
public PromptTemplatesApi(@Nonnull com.sap.cloud.sdk.services.openapi.apache.apiclient.ApiClient apiClient) Instantiates this API class to invoke operations on the Prompt Registry API based on a givenApiClient.- Parameters:
apiClient- ApiClient to invoke the API on
-
-
Method Details
-
withDefaultHeaders
Creates a new API instance with additional default headers.- Parameters:
defaultHeaders- Additional headers to include in all requests- Returns:
- A new API instance with the combined headers
-
createUpdatePromptTemplate
@Nonnull public PromptTemplatePostResponse createUpdatePromptTemplate(@Nonnull PromptTemplatePostRequest promptTemplatePostRequest, @Nullable String aiResourceGroup, @Nullable String aiResourceGroupScope) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException Create or update a prompt template200 - Successful response
400 - Bad Request
403 - Forbidden Error
0 - Common Error
- Parameters:
promptTemplatePostRequest- (required) The value for the parameter promptTemplatePostRequestaiResourceGroup- (optional) Specify a resource group id to useaiResourceGroupScope- (optional) Specify whether the resource group scope is to be used- Returns:
- PromptTemplatePostResponse
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-
createUpdatePromptTemplate
@Nonnull public PromptTemplatePostResponse createUpdatePromptTemplate(@Nonnull PromptTemplatePostRequest promptTemplatePostRequest) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException Create or update a prompt template200 - Successful response
400 - Bad Request
403 - Forbidden Error
0 - Common Error
- Parameters:
promptTemplatePostRequest- The value for the parameter promptTemplatePostRequest- Returns:
- PromptTemplatePostResponse
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-
deletePromptTemplate
@Nonnull public PromptTemplateDeleteResponse deletePromptTemplate(@Nonnull UUID promptTemplateId, @Nullable String aiResourceGroup, @Nullable String aiResourceGroupScope) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException Delete prompt template200 - Successful response
403 - Forbidden Error
404 - Bad Request
0 - Common Error
- Parameters:
promptTemplateId- (required) The value for the parameter promptTemplateIdaiResourceGroup- (optional) Specify a resource group id to useaiResourceGroupScope- (optional) Specify whether the resource group scope is to be used- Returns:
- PromptTemplateDeleteResponse
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-
deletePromptTemplate
@Nonnull public PromptTemplateDeleteResponse deletePromptTemplate(@Nonnull UUID promptTemplateId) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException Delete prompt template200 - Successful response
403 - Forbidden Error
404 - Bad Request
0 - Common Error
- Parameters:
promptTemplateId- The value for the parameter promptTemplateId- Returns:
- PromptTemplateDeleteResponse
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-
exportPromptTemplate
@Nonnull public byte[] exportPromptTemplate(@Nonnull UUID promptTemplateId, @Nullable String aiResourceGroup, @Nullable String aiResourceGroupScope) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException Export prompt template200 - Successful response
400 - Bad Request
0 - Common Error
- Parameters:
promptTemplateId- (required) The value for the parameter promptTemplateIdaiResourceGroup- (optional) Specify a resource group id to useaiResourceGroupScope- (optional) Specify whether the resource group scope is to be used- Returns:
- byte[]
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-
exportPromptTemplate
@Nonnull public byte[] exportPromptTemplate(@Nonnull UUID promptTemplateId) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException Export prompt template200 - Successful response
400 - Bad Request
0 - Common Error
- Parameters:
promptTemplateId- The value for the parameter promptTemplateId- Returns:
- byte[]
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-
getPromptTemplateByUuid
@Nonnull public PromptTemplateGetResponse getPromptTemplateByUuid(@Nonnull UUID promptTemplateId, @Nullable String aiResourceGroup, @Nullable String aiResourceGroupScope) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException Get prompt template by UUID200 - Successful response
400 - Bad Request
403 - Forbidden Error
0 - Common Error
- Parameters:
promptTemplateId- (required) The value for the parameter promptTemplateIdaiResourceGroup- (optional) Specify a resource group id to useaiResourceGroupScope- (optional) Specify whether the resource group scope is to be used- Returns:
- PromptTemplateGetResponse
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-
getPromptTemplateByUuid
@Nonnull public PromptTemplateGetResponse getPromptTemplateByUuid(@Nonnull UUID promptTemplateId) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException Get prompt template by UUID200 - Successful response
400 - Bad Request
403 - Forbidden Error
0 - Common Error
- Parameters:
promptTemplateId- The value for the parameter promptTemplateId- Returns:
- PromptTemplateGetResponse
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-
importPromptTemplate
@Nonnull public PromptTemplatePostResponse importPromptTemplate(@Nullable String aiResourceGroup, @Nullable String aiResourceGroupScope, @Nullable File _file) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException Import prompt template200 - Successful response
400 - Bad Request
0 - Common Error
- Parameters:
aiResourceGroup- (optional) Specify a resource group id to useaiResourceGroupScope- (optional) Specify whether the resource group scope is to be used_file- (optional) The value for the parameter _file- Returns:
- PromptTemplatePostResponse
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-
importPromptTemplate
@Nonnull public PromptTemplatePostResponse importPromptTemplate() throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestExceptionImport prompt template200 - Successful response
400 - Bad Request
0 - Common Error
- Returns:
- PromptTemplatePostResponse
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-
listPromptTemplateHistory
@Nonnull public PromptTemplateListResponse listPromptTemplateHistory(@Nonnull String scenario, @Nonnull String version, @Nonnull String name, @Nullable String aiResourceGroup, @Nullable String aiResourceGroupScope) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException List prompt template history200 - Successful response
400 - Bad Request
403 - Forbidden Error
0 - Common Error
- Parameters:
scenario- (required) The value for the parameter scenarioversion- (required) The value for the parameter versionname- (required) The value for the parameter nameaiResourceGroup- (optional) Specify a resource group id to useaiResourceGroupScope- (optional) Specify whether the resource group scope is to be used- Returns:
- PromptTemplateListResponse
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-
listPromptTemplateHistory
@Nonnull public PromptTemplateListResponse listPromptTemplateHistory(@Nonnull String scenario, @Nonnull String version, @Nonnull String name) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException List prompt template history200 - Successful response
400 - Bad Request
403 - Forbidden Error
0 - Common Error
- Parameters:
scenario- The value for the parameter scenarioversion- The value for the parameter versionname- The value for the parameter name- Returns:
- PromptTemplateListResponse
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-
listPromptTemplates
@Nonnull public PromptTemplateListResponse listPromptTemplates(@Nullable String aiResourceGroup, @Nullable String aiResourceGroupScope, @Nullable String scenario, @Nullable String name, @Nullable String version, @Nullable String retrieve, @Nullable Boolean includeSpec) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException List prompt templates200 - Successful response
400 - Bad Request
403 - Forbidden Error
0 - Common Error
- Parameters:
aiResourceGroup- (optional) Specify a resource group id to useaiResourceGroupScope- (optional) Specify whether the resource group scope is to be usedscenario- (optional) The value for the parameter scenarioname- (optional) The value for the parameter nameversion- (optional) The value for the parameter versionretrieve- (optional, default to both) The value for the parameter retrieveincludeSpec- (optional, default to false) The value for the parameter includeSpec- Returns:
- PromptTemplateListResponse
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-
listPromptTemplates
@Nonnull public PromptTemplateListResponse listPromptTemplates() throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestExceptionList prompt templates200 - Successful response
400 - Bad Request
403 - Forbidden Error
0 - Common Error
- Returns:
- PromptTemplateListResponse
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-
parsePromptTemplateById
@Nonnull public PromptTemplateSubstitutionResponse parsePromptTemplateById(@Nonnull UUID promptTemplateId, @Nullable String aiResourceGroup, @Nullable String aiResourceGroupScope, @Nullable Boolean metadata, @Nullable PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException Parse prompt template by ID200 - Successful response
400 - Bad Request
403 - Forbidden Error
0 - Common Error
- Parameters:
promptTemplateId- (required) The value for the parameter promptTemplateIdaiResourceGroup- (optional) Specify a resource group id to useaiResourceGroupScope- (optional) Specify whether the resource group scope is to be usedmetadata- (optional, default to false) The value for the parameter metadatapromptTemplateSubstitutionRequest- (optional) The value for the parameter promptTemplateSubstitutionRequest- Returns:
- PromptTemplateSubstitutionResponse
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-
parsePromptTemplateById
@Nonnull public PromptTemplateSubstitutionResponse parsePromptTemplateById(@Nonnull UUID promptTemplateId) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException Parse prompt template by ID200 - Successful response
400 - Bad Request
403 - Forbidden Error
0 - Common Error
- Parameters:
promptTemplateId- The value for the parameter promptTemplateId- Returns:
- PromptTemplateSubstitutionResponse
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-
parsePromptTemplateByNameVersion
@Nonnull public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion(@Nonnull String scenario, @Nonnull String version, @Nonnull String name, @Nullable String aiResourceGroup, @Nullable String aiResourceGroupScope, @Nullable Boolean metadata, @Nullable PromptTemplateSubstitutionRequest promptTemplateSubstitutionRequest) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException Parse prompt template by name and version200 - Successful response
400 - Bad Request
403 - Forbidden Error
0 - Common Error
- Parameters:
scenario- (required) The value for the parameter scenarioversion- (required) The value for the parameter versionname- (required) The value for the parameter nameaiResourceGroup- (optional) Specify a resource group id to useaiResourceGroupScope- (optional) Specify whether the resource group scope is to be usedmetadata- (optional, default to false) The value for the parameter metadatapromptTemplateSubstitutionRequest- (optional) The value for the parameter promptTemplateSubstitutionRequest- Returns:
- PromptTemplateSubstitutionResponse
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-
parsePromptTemplateByNameVersion
@Nonnull public PromptTemplateSubstitutionResponse parsePromptTemplateByNameVersion(@Nonnull String scenario, @Nonnull String version, @Nonnull String name) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException Parse prompt template by name and version200 - Successful response
400 - Bad Request
403 - Forbidden Error
0 - Common Error
- Parameters:
scenario- The value for the parameter scenarioversion- The value for the parameter versionname- The value for the parameter name- Returns:
- PromptTemplateSubstitutionResponse
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-