Class PromptTemplatesApi

java.lang.Object
com.sap.cloud.sdk.services.openapi.apache.apiclient.BaseApi
com.sap.ai.sdk.prompt.registry.client.PromptTemplatesApi
Direct Known Subclasses:
PromptClient

public class PromptTemplatesApi extends com.sap.cloud.sdk.services.openapi.apache.apiclient.BaseApi
Prompt Registry API in version 0.0.1.

Prompt Storage service for Design time invalid input: '&' Runtime prompt templates.

  • 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 given ApiClient.
      Parameters:
      apiClient - ApiClient to invoke the API on
  • Method Details

    • withDefaultHeaders

      public PromptTemplatesApi withDefaultHeaders(@Nonnull Map<String,String> defaultHeaders)
      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 template

      200 - Successful response

      400 - Bad Request

      403 - Forbidden Error

      0 - Common Error

      Parameters:
      promptTemplatePostRequest - (required) The value for the parameter promptTemplatePostRequest
      aiResourceGroup - (optional) Specify a resource group id to use
      aiResourceGroupScope - (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 template

      200 - 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 template

      200 - Successful response

      403 - Forbidden Error

      404 - Bad Request

      0 - Common Error

      Parameters:
      promptTemplateId - (required) The value for the parameter promptTemplateId
      aiResourceGroup - (optional) Specify a resource group id to use
      aiResourceGroupScope - (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 template

      200 - 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 template

      200 - Successful response

      400 - Bad Request

      0 - Common Error

      Parameters:
      promptTemplateId - (required) The value for the parameter promptTemplateId
      aiResourceGroup - (optional) Specify a resource group id to use
      aiResourceGroupScope - (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 template

      200 - 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 UUID

      200 - Successful response

      400 - Bad Request

      403 - Forbidden Error

      0 - Common Error

      Parameters:
      promptTemplateId - (required) The value for the parameter promptTemplateId
      aiResourceGroup - (optional) Specify a resource group id to use
      aiResourceGroupScope - (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 UUID

      200 - 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 template

      200 - Successful response

      400 - Bad Request

      0 - Common Error

      Parameters:
      aiResourceGroup - (optional) Specify a resource group id to use
      aiResourceGroupScope - (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.OpenApiRequestException
      Import prompt template

      200 - 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 history

      200 - Successful response

      400 - Bad Request

      403 - Forbidden Error

      0 - Common Error

      Parameters:
      scenario - (required) The value for the parameter scenario
      version - (required) The value for the parameter version
      name - (required) The value for the parameter name
      aiResourceGroup - (optional) Specify a resource group id to use
      aiResourceGroupScope - (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 history

      200 - Successful response

      400 - Bad Request

      403 - Forbidden Error

      0 - Common Error

      Parameters:
      scenario - The value for the parameter scenario
      version - The value for the parameter version
      name - 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 templates

      200 - Successful response

      400 - Bad Request

      403 - Forbidden Error

      0 - Common Error

      Parameters:
      aiResourceGroup - (optional) Specify a resource group id to use
      aiResourceGroupScope - (optional) Specify whether the resource group scope is to be used
      scenario - (optional) The value for the parameter scenario
      name - (optional) The value for the parameter name
      version - (optional) The value for the parameter version
      retrieve - (optional, default to both) The value for the parameter retrieve
      includeSpec - (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.OpenApiRequestException
      List prompt templates

      200 - 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 ID

      200 - Successful response

      400 - Bad Request

      403 - Forbidden Error

      0 - Common Error

      Parameters:
      promptTemplateId - (required) The value for the parameter promptTemplateId
      aiResourceGroup - (optional) Specify a resource group id to use
      aiResourceGroupScope - (optional) Specify whether the resource group scope is to be used
      metadata - (optional, default to false) The value for the parameter metadata
      promptTemplateSubstitutionRequest - (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 ID

      200 - 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 version

      200 - Successful response

      400 - Bad Request

      403 - Forbidden Error

      0 - Common Error

      Parameters:
      scenario - (required) The value for the parameter scenario
      version - (required) The value for the parameter version
      name - (required) The value for the parameter name
      aiResourceGroup - (optional) Specify a resource group id to use
      aiResourceGroupScope - (optional) Specify whether the resource group scope is to be used
      metadata - (optional, default to false) The value for the parameter metadata
      promptTemplateSubstitutionRequest - (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 version

      200 - Successful response

      400 - Bad Request

      403 - Forbidden Error

      0 - Common Error

      Parameters:
      scenario - The value for the parameter scenario
      version - The value for the parameter version
      name - 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