Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* FreeChat OpenAPI Definition
* # FreeChat: Create Friends for Yourself with AI English | [中文版](https://github.com/freechat-fun/freechat/blob/main/README.zh-CN.md) ## Introduction Welcome! FreeChat aims to build a cloud-native, robust, and quickly commercializable enterprise-level AI virtual character platform. It also serves as a prompt engineering platform. ## Features - Primarily uses Java and emphasizes **security, robustness, scalability, traceability, and maintainability**. - Boasts **account systems and permission management**, supporting OAuth2 authentication. Introduces the \"organization\" concept and related permission constraint functions. - Extensively employs distributed technologies and caching to support **high concurrency** access. - Provides flexible character customization options, supports direct intervention in prompts, and supports **configuring multiple backends for each character**. - **Offers a comprehensive range of Open APIs**, with more than 180 interfaces and provides java/python/typescript SDKs. These interfaces enable easy construction of systems for end-users. - Supports setting **RAG** (Retrieval Augmented Generation) for characters. - Supports **long-term memory, preset memory** for characters. - Supports characters evoking **proactive chat**. - Supports setting **quota limits** for characters. - Supports characters **importing and exporting**. - Supports individual **debugging and sharing prompts**. ## Snapshots ### On PC #### Home Page ![Home Page Snapshot](/img/snapshot_w1.jpg) #### Development View ![Development View Snapshot](/img/snapshot_w2.jpg) #### Chat View ![Chat View Snapshot](/img/snapshot_w3.jpg) ### On Mobile ![Chat Snapshot 1](/img/snapshot_m1.jpg) ![Chat Snapshot 2](/img/snapshot_m2.jpg) ![Chat Snapshot 3](/img/snapshot_m3.jpg) ![Chat Snapshot 4](/img/snapshot_m4.jpg) ## Character Design ```mermaid flowchart TD A(Character) --> B(Profile) A --> C(Knowledge/RAG) A --> D(Album) A --> E(Backend-1) A --> F(Backend-n...) E --> G(Message Window) E --> H(Long Term Memory Settings) E --> I(Quota Limit) E --> J(Chat Prompt Task) E --> K(Greeting Prompt Task) E --> L(Moderation Settings) J --> M(Model & Parameters) J --> N(API Keys) J --> O(Prompt Refence) J --> P(Tool Specifications) O --> Q(Template) O --> R(Variables) O --> S(Version) O --> T(...) style K stroke-dasharray: 5, 5 style L stroke-dasharray: 5, 5 style P stroke-dasharray: 5, 5 ``` After setting up an unified persona and knowledge for a character, different backends can be configured. For example, different model may be adopted for different users based on cost considerations. ## How to Play ### Online Website You can visit [freechat.fun](https://freechat.fun) to experience FreeChat. Share your designed AI character! ### Running in a Kubernetes Cluster FreeChat is dedicated to the principles of cloud-native design. If you have a Kubernetes cluster, you can deploy FreeChat to your environment by following these steps: 1. Put the Kubernetes configuration file in the `configs/helm/` directory, named `kube-private.conf`. 2. Place the Helm configuration file in the same directory, named `values-private.yaml`. Make sure to reference the default `values.yaml` and customize the variables as needed. 3. Switch to the `scripts/` directory. 4. If needed, run `install-in.sh` to deploy `ingress-nginx` on the Kubernetes cluster. 5. If needed, run `install-cm.sh` to deploy `cert-manager` on the Kubernetes cluster, which automatically issues certificates for domains specified in `ingress.hosts`. 6. Run `install-pvc.sh` to install PersistentVolumeClaim resources. > By default, FreeChat operates files by accessing the \"local file system.\" You may want to use high-availability distributed storage in the cloud. As a cloud-native-designed system, we recommend interfacing through Kubernetes CSI to avoid individually adapting storage products for each cloud platform. Most cloud service providers offer cloud storage drivers for Kubernetes, with a series of predefined StorageClass resources. Please choose the appropriate configuration according to your actual needs and set it in Helm's `global.storageClass` option. > > *In the future, FreeChat may be refactored to use MinIO's APIs directly, as it is now installed in the Kubernetes cluster as a dependency (serving Milvus).* 7. Run `install.sh` script to install FreeChat and its dependencies. 8. FreeChat aims to provide Open API services. If you like the interactive experience of [freechat.fun](https://freechat.fun), run `install-web.sh` to deploy the front-end application. 9. Run `restart.sh` to restart the service. 10. If you modified any Helm configuration files, use `upgrade.sh` to update the corresponding Kubernetes resources. 11. To remove specific resources, run the `uninstall*.sh` script corresponding to the resource you want to uninstall. As a cloud-native application, the services FreeChat relies on are obtained and deployed to your cluster through the helm repository. If you prefer cloud services with SLA (Service Level Agreement) guarantees, simply make the relevant settings in `configs/helm/values-private.yaml`: ```yaml mysql: deployment: enabled: false url: auth: rootPassword: username: password: redis: deployment: enabled: false url: auth: password: milvus: deployment: enabled: false url: milvus: auth: token: ``` With this, FreeChat will not automatically install these services, but rather use the configuration information to connect directly. If your Kubernetes cluster does not have a standalone monitoring system, you can enable the following switch. This will install Prometheus and Grafana services in the same namespace, dedicated to monitoring the status of the services under the FreeChat application: ```yaml prometheus: deployment: enabled: true grafana: deployment: enabled: true ``` ### Running Locally You can also run FreeChat locally. Currently supported on MacOS and Linux (although only tested on MacOS). You need to install the Docker toolset and have a network that can access [Docker Hub](https://hub.docker.com/). Once ready, enter the `scripts/` directory and run `local-run.sh`, which will download and run the necessary docker containers. After a successful startup, you can access `http://localhost` via a browser to see the locally running freechat.fun. The built-in administrator username and password are \"admin:freechat\". Use `local-run.sh --help` to view the supported options of the script. Good luck! ### Running in an IDE To run FreeChat in an IDE, you need to start all dependent services first but do not need to run the container for the FreeChat application itself. You can execute the `scripts/local-deps.sh` script to start services like `MySQL`, `Redis`, `Milvus`, etc., locally. Once done, open and debug `freechat-start/src/main/java/fun/freechat/Application.java`。Make sure you have set the following startup VM options: ```shell -Dspring.config.location=classpath:/application.yml,classpath:/application-local.yml \\ -DAPP_HOME=local-data/freechat \\ -Dspring.profiles.active=local ``` ### Use SDK #### Java - **Dependency** ```xml fun.freechatfreechat-sdk${freechat-sdk.version} ``` - **Example** ```java import fun.freechat.client.ApiClient; import fun.freechat.client.ApiException; import fun.freechat.client.Configuration; import fun.freechat.client.api.AccountApi; import fun.freechat.client.auth.ApiKeyAuth; import fun.freechat.client.model.UserDetailsDTO; public class AccountClientExample { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath(\"https://freechat.fun\"); // Configure HTTP bearer authorization: bearerAuth HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication(\"bearerAuth\"); bearerAuth.setBearerToken(\"FREECHAT_TOKEN\"); AccountApi apiInstance = new AccountApi(defaultClient); try { UserDetailsDTO result = apiInstance.getUserDetails(); System.out.println(result); } catch (ApiException e) { e.printStackTrace(); } } } ``` #### Python - **Installation** ```shell pip install freechat-sdk ``` - **Example** ```python import freechat_sdk from freechat_sdk.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://freechat.fun # See configuration.py for a list of all supported configuration parameters. configuration = freechat_sdk.Configuration( host = \"https://freechat.fun\" ) # Configure Bearer authorization: bearerAuth configuration = freechat_sdk.Configuration( access_token = os.environ[\"FREECHAT_TOKEN\"] ) # Enter a context with an instance of the API client with freechat_sdk.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = freechat_sdk.AccountApi(api_client) try: details = api_instance.get_user_details() pprint(details) except ApiException as e: print(\"Exception when calling AccountClient->get_user_details: %s\\n\" % e) ``` #### TypeScript - **Installation** ```shell npm install freechat-sdk --save ``` - **Example** Refer to [FreeChatApiContext.tsx](https://github.com/freechat-fun/freechat/blob/main/freechat-web/src/contexts/FreeChatApiProvider.tsx) ## System Dependencies | | Projects | ---- | ---- | Application Framework | [Spring Boot](https://spring.io/projects/spring-boot/) | LLM Framework | [LangChain4j](https://docs.langchain4j.dev/) | Model Providers | [OpenAI](https://platform.openai.com/), [Azure OpenAI](https://oai.azure.com/), [DashScope(Alibaba)](https://dashscope.aliyun.com/) | Database Systems | [MySQL](https://www.mysql.com/), [Redis](https://redis.io/), [Milvus](https://milvus.io/) | Monitoring & Alerting | [Kube State Metrics](https://kubernetes.io/docs/concepts/cluster-administration/kube-state-metrics/), [Prometheus](https://prometheus.io/), [Promtail](https://grafana.com/docs/loki/latest/send-data/promtail/), [Loki](https://grafana.com/oss/loki/), [Grafana](https://grafana.com/) | OpenAPI Tools | [Springdoc-openapi](https://springdoc.org/), [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator), [OpenAPI Explorer](https://github.com/Authress-Engineering/openapi-explorer) ## Collaboration ### Application Integration The FreeChat system is entirely oriented towards Open APIs. The site [freechat.fun](https://freechat.fun) is developed using its TypeScript SDK and hardly depends on private interfaces. You can use these online interfaces to develop your own applications or sites, making them fit your preferences. Currently, FreeChat is completely free with no paid plans (after all, users use their own API Key to call LLM services). ### Model Integration FreeChat aims to explore AI virtual character technology with anthropomorphic characteristics. So far, it supports model services from OpenAI GPT and Alibaba Qwen series models. However, we are more interested in supporting models that are under research and can endow AI with more personality traits. If you are researching this area and hope FreeChat supports your model, please contact us. We look forward to AI technology helping people create their own \"soul mates\" in the future.
*
* The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package fun.freechat.client.api;
import fun.freechat.client.ApiCallback;
import fun.freechat.client.ApiClient;
import fun.freechat.client.ApiException;
import fun.freechat.client.ApiResponse;
import fun.freechat.client.Configuration;
import fun.freechat.client.Pair;
import fun.freechat.client.ProgressRequestBody;
import fun.freechat.client.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import fun.freechat.client.model.LlmResultDTO;
import fun.freechat.client.model.PromptAiParamDTO;
import fun.freechat.client.model.PromptCreateDTO;
import fun.freechat.client.model.PromptDetailsDTO;
import fun.freechat.client.model.PromptItemForNameDTO;
import fun.freechat.client.model.PromptQueryDTO;
import fun.freechat.client.model.PromptRefDTO;
import fun.freechat.client.model.PromptSummaryDTO;
import fun.freechat.client.model.PromptTemplateDTO;
import fun.freechat.client.model.PromptUpdateDTO;
import fun.freechat.client.model.SseEmitter;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class PromptApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public PromptApi() {
this(Configuration.getDefaultApiClient());
}
public PromptApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for applyPromptRef
* @param promptRefDTO Prompt record (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call applyPromptRefCall(PromptRefDTO promptRefDTO, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = promptRefDTO;
// create path and map variables
String localVarPath = "/api/v1/prompt/apply/ref";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"text/plain"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call applyPromptRefValidateBeforeCall(PromptRefDTO promptRefDTO, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'promptRefDTO' is set
if (promptRefDTO == null) {
throw new ApiException("Missing the required parameter 'promptRefDTO' when calling applyPromptRef(Async)");
}
return applyPromptRefCall(promptRefDTO, _callback);
}
/**
* Apply Parameters to Prompt Record
* Apply parameters to prompt record.
* @param promptRefDTO Prompt record (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public String applyPromptRef(PromptRefDTO promptRefDTO) throws ApiException {
ApiResponse localVarResp = applyPromptRefWithHttpInfo(promptRefDTO);
return localVarResp.getData();
}
/**
* Apply Parameters to Prompt Record
* Apply parameters to prompt record.
* @param promptRefDTO Prompt record (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public ApiResponse applyPromptRefWithHttpInfo(PromptRefDTO promptRefDTO) throws ApiException {
okhttp3.Call localVarCall = applyPromptRefValidateBeforeCall(promptRefDTO, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Apply Parameters to Prompt Record (asynchronously)
* Apply parameters to prompt record.
* @param promptRefDTO Prompt record (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call applyPromptRefAsync(PromptRefDTO promptRefDTO, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = applyPromptRefValidateBeforeCall(promptRefDTO, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for applyPromptTemplate
* @param promptTemplateDTO String type prompt template (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call applyPromptTemplateCall(PromptTemplateDTO promptTemplateDTO, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = promptTemplateDTO;
// create path and map variables
String localVarPath = "/api/v1/prompt/apply/template";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"text/plain"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call applyPromptTemplateValidateBeforeCall(PromptTemplateDTO promptTemplateDTO, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'promptTemplateDTO' is set
if (promptTemplateDTO == null) {
throw new ApiException("Missing the required parameter 'promptTemplateDTO' when calling applyPromptTemplate(Async)");
}
return applyPromptTemplateCall(promptTemplateDTO, _callback);
}
/**
* Apply Parameters to Prompt Template
* Apply parameters to prompt template.
* @param promptTemplateDTO String type prompt template (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public String applyPromptTemplate(PromptTemplateDTO promptTemplateDTO) throws ApiException {
ApiResponse localVarResp = applyPromptTemplateWithHttpInfo(promptTemplateDTO);
return localVarResp.getData();
}
/**
* Apply Parameters to Prompt Template
* Apply parameters to prompt template.
* @param promptTemplateDTO String type prompt template (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public ApiResponse applyPromptTemplateWithHttpInfo(PromptTemplateDTO promptTemplateDTO) throws ApiException {
okhttp3.Call localVarCall = applyPromptTemplateValidateBeforeCall(promptTemplateDTO, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Apply Parameters to Prompt Template (asynchronously)
* Apply parameters to prompt template.
* @param promptTemplateDTO String type prompt template (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call applyPromptTemplateAsync(PromptTemplateDTO promptTemplateDTO, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = applyPromptTemplateValidateBeforeCall(promptTemplateDTO, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for batchSearchPromptDetails
* @param promptQueryDTO Query conditions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call batchSearchPromptDetailsCall(List promptQueryDTO, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = promptQueryDTO;
// create path and map variables
String localVarPath = "/api/v1/prompt/batch/details/search";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call batchSearchPromptDetailsValidateBeforeCall(List promptQueryDTO, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'promptQueryDTO' is set
if (promptQueryDTO == null) {
throw new ApiException("Missing the required parameter 'promptQueryDTO' when calling batchSearchPromptDetails(Async)");
}
return batchSearchPromptDetailsCall(promptQueryDTO, _callback);
}
/**
* Batch Search Prompt Details
* Batch call shortcut for /api/v1/prompt/details/search.
* @param promptQueryDTO Query conditions (required)
* @return List<List<PromptDetailsDTO>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public List> batchSearchPromptDetails(List promptQueryDTO) throws ApiException {
ApiResponse>> localVarResp = batchSearchPromptDetailsWithHttpInfo(promptQueryDTO);
return localVarResp.getData();
}
/**
* Batch Search Prompt Details
* Batch call shortcut for /api/v1/prompt/details/search.
* @param promptQueryDTO Query conditions (required)
* @return ApiResponse<List<List<PromptDetailsDTO>>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public ApiResponse>> batchSearchPromptDetailsWithHttpInfo(List promptQueryDTO) throws ApiException {
okhttp3.Call localVarCall = batchSearchPromptDetailsValidateBeforeCall(promptQueryDTO, null);
Type localVarReturnType = new TypeToken>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Batch Search Prompt Details (asynchronously)
* Batch call shortcut for /api/v1/prompt/details/search.
* @param promptQueryDTO Query conditions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call batchSearchPromptDetailsAsync(List promptQueryDTO, final ApiCallback>> _callback) throws ApiException {
okhttp3.Call localVarCall = batchSearchPromptDetailsValidateBeforeCall(promptQueryDTO, _callback);
Type localVarReturnType = new TypeToken>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for batchSearchPromptSummary
* @param promptQueryDTO Query conditions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call batchSearchPromptSummaryCall(List promptQueryDTO, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = promptQueryDTO;
// create path and map variables
String localVarPath = "/api/v1/prompt/batch/search";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call batchSearchPromptSummaryValidateBeforeCall(List promptQueryDTO, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'promptQueryDTO' is set
if (promptQueryDTO == null) {
throw new ApiException("Missing the required parameter 'promptQueryDTO' when calling batchSearchPromptSummary(Async)");
}
return batchSearchPromptSummaryCall(promptQueryDTO, _callback);
}
/**
* Batch Search Prompt Summaries
* Batch call shortcut for /api/v1/prompt/search.
* @param promptQueryDTO Query conditions (required)
* @return List<List<PromptSummaryDTO>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public List> batchSearchPromptSummary(List promptQueryDTO) throws ApiException {
ApiResponse>> localVarResp = batchSearchPromptSummaryWithHttpInfo(promptQueryDTO);
return localVarResp.getData();
}
/**
* Batch Search Prompt Summaries
* Batch call shortcut for /api/v1/prompt/search.
* @param promptQueryDTO Query conditions (required)
* @return ApiResponse<List<List<PromptSummaryDTO>>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public ApiResponse>> batchSearchPromptSummaryWithHttpInfo(List promptQueryDTO) throws ApiException {
okhttp3.Call localVarCall = batchSearchPromptSummaryValidateBeforeCall(promptQueryDTO, null);
Type localVarReturnType = new TypeToken>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Batch Search Prompt Summaries (asynchronously)
* Batch call shortcut for /api/v1/prompt/search.
* @param promptQueryDTO Query conditions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call batchSearchPromptSummaryAsync(List promptQueryDTO, final ApiCallback>> _callback) throws ApiException {
okhttp3.Call localVarCall = batchSearchPromptSummaryValidateBeforeCall(promptQueryDTO, _callback);
Type localVarReturnType = new TypeToken>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for clonePrompt
* @param promptId The referenced promptId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call clonePromptCall(Long promptId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v1/prompt/clone/{promptId}"
.replace("{" + "promptId" + "}", localVarApiClient.escapeString(promptId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call clonePromptValidateBeforeCall(Long promptId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'promptId' is set
if (promptId == null) {
throw new ApiException("Missing the required parameter 'promptId' when calling clonePrompt(Async)");
}
return clonePromptCall(promptId, _callback);
}
/**
* Clone Prompt
* Enter the promptId, generate a new record, the content is basically the same as the original prompt, but the following fields are different: - Version number is 1 - Visibility is private - The parent prompt is the source promptId - The creation time is the current moment. - All statistical indicators are zeroed. Return the new promptId.
* @param promptId The referenced promptId (required)
* @return Long
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public Long clonePrompt(Long promptId) throws ApiException {
ApiResponse localVarResp = clonePromptWithHttpInfo(promptId);
return localVarResp.getData();
}
/**
* Clone Prompt
* Enter the promptId, generate a new record, the content is basically the same as the original prompt, but the following fields are different: - Version number is 1 - Visibility is private - The parent prompt is the source promptId - The creation time is the current moment. - All statistical indicators are zeroed. Return the new promptId.
* @param promptId The referenced promptId (required)
* @return ApiResponse<Long>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public ApiResponse clonePromptWithHttpInfo(Long promptId) throws ApiException {
okhttp3.Call localVarCall = clonePromptValidateBeforeCall(promptId, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Clone Prompt (asynchronously)
* Enter the promptId, generate a new record, the content is basically the same as the original prompt, but the following fields are different: - Version number is 1 - Visibility is private - The parent prompt is the source promptId - The creation time is the current moment. - All statistical indicators are zeroed. Return the new promptId.
* @param promptId The referenced promptId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call clonePromptAsync(Long promptId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = clonePromptValidateBeforeCall(promptId, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for clonePrompts
* @param requestBody List of prompt information to be created (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call clonePromptsCall(List requestBody, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = requestBody;
// create path and map variables
String localVarPath = "/api/v1/prompt/batch/clone";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call clonePromptsValidateBeforeCall(List requestBody, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'requestBody' is set
if (requestBody == null) {
throw new ApiException("Missing the required parameter 'requestBody' when calling clonePrompts(Async)");
}
return clonePromptsCall(requestBody, _callback);
}
/**
* Batch Clone Prompts
* Batch clone multiple prompts. Ensure transactionality, return the promptId list after success.
* @param requestBody List of prompt information to be created (required)
* @return List<Long>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public List clonePrompts(List requestBody) throws ApiException {
ApiResponse> localVarResp = clonePromptsWithHttpInfo(requestBody);
return localVarResp.getData();
}
/**
* Batch Clone Prompts
* Batch clone multiple prompts. Ensure transactionality, return the promptId list after success.
* @param requestBody List of prompt information to be created (required)
* @return ApiResponse<List<Long>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public ApiResponse> clonePromptsWithHttpInfo(List requestBody) throws ApiException {
okhttp3.Call localVarCall = clonePromptsValidateBeforeCall(requestBody, null);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Batch Clone Prompts (asynchronously)
* Batch clone multiple prompts. Ensure transactionality, return the promptId list after success.
* @param requestBody List of prompt information to be created (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call clonePromptsAsync(List requestBody, final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = clonePromptsValidateBeforeCall(requestBody, _callback);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for countPrompts
* @param promptQueryDTO Query conditions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call countPromptsCall(PromptQueryDTO promptQueryDTO, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = promptQueryDTO;
// create path and map variables
String localVarPath = "/api/v1/prompt/count";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call countPromptsValidateBeforeCall(PromptQueryDTO promptQueryDTO, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'promptQueryDTO' is set
if (promptQueryDTO == null) {
throw new ApiException("Missing the required parameter 'promptQueryDTO' when calling countPrompts(Async)");
}
return countPromptsCall(promptQueryDTO, _callback);
}
/**
* Calculate Number of Prompts
* Calculate the number of prompts according to the specified query conditions.
* @param promptQueryDTO Query conditions (required)
* @return Long
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public Long countPrompts(PromptQueryDTO promptQueryDTO) throws ApiException {
ApiResponse localVarResp = countPromptsWithHttpInfo(promptQueryDTO);
return localVarResp.getData();
}
/**
* Calculate Number of Prompts
* Calculate the number of prompts according to the specified query conditions.
* @param promptQueryDTO Query conditions (required)
* @return ApiResponse<Long>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public ApiResponse countPromptsWithHttpInfo(PromptQueryDTO promptQueryDTO) throws ApiException {
okhttp3.Call localVarCall = countPromptsValidateBeforeCall(promptQueryDTO, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Calculate Number of Prompts (asynchronously)
* Calculate the number of prompts according to the specified query conditions.
* @param promptQueryDTO Query conditions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call countPromptsAsync(PromptQueryDTO promptQueryDTO, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = countPromptsValidateBeforeCall(promptQueryDTO, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for countPublicPrompts
* @param promptQueryDTO Query conditions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call countPublicPromptsCall(PromptQueryDTO promptQueryDTO, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = promptQueryDTO;
// create path and map variables
String localVarPath = "/api/v1/public/prompt/count";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call countPublicPromptsValidateBeforeCall(PromptQueryDTO promptQueryDTO, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'promptQueryDTO' is set
if (promptQueryDTO == null) {
throw new ApiException("Missing the required parameter 'promptQueryDTO' when calling countPublicPrompts(Async)");
}
return countPublicPromptsCall(promptQueryDTO, _callback);
}
/**
* Calculate Number of Public Prompts
* Calculate the number of prompts according to the specified query conditions.
* @param promptQueryDTO Query conditions (required)
* @return Long
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public Long countPublicPrompts(PromptQueryDTO promptQueryDTO) throws ApiException {
ApiResponse localVarResp = countPublicPromptsWithHttpInfo(promptQueryDTO);
return localVarResp.getData();
}
/**
* Calculate Number of Public Prompts
* Calculate the number of prompts according to the specified query conditions.
* @param promptQueryDTO Query conditions (required)
* @return ApiResponse<Long>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public ApiResponse countPublicPromptsWithHttpInfo(PromptQueryDTO promptQueryDTO) throws ApiException {
okhttp3.Call localVarCall = countPublicPromptsValidateBeforeCall(promptQueryDTO, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Calculate Number of Public Prompts (asynchronously)
* Calculate the number of prompts according to the specified query conditions.
* @param promptQueryDTO Query conditions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call countPublicPromptsAsync(PromptQueryDTO promptQueryDTO, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = countPublicPromptsValidateBeforeCall(promptQueryDTO, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for createPrompt
* @param promptCreateDTO Information of the prompt to be created (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call createPromptCall(PromptCreateDTO promptCreateDTO, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = promptCreateDTO;
// create path and map variables
String localVarPath = "/api/v1/prompt";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createPromptValidateBeforeCall(PromptCreateDTO promptCreateDTO, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'promptCreateDTO' is set
if (promptCreateDTO == null) {
throw new ApiException("Missing the required parameter 'promptCreateDTO' when calling createPrompt(Async)");
}
return createPromptCall(promptCreateDTO, _callback);
}
/**
* Create Prompt
* Create a prompt, required fields: - Prompt name - Prompt content - Applicable model Limitations: - Description: 300 characters - Template: 1000 characters - Example: 2000 characters - Tags: 5 - Parameters: 10
* @param promptCreateDTO Information of the prompt to be created (required)
* @return Long
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public Long createPrompt(PromptCreateDTO promptCreateDTO) throws ApiException {
ApiResponse localVarResp = createPromptWithHttpInfo(promptCreateDTO);
return localVarResp.getData();
}
/**
* Create Prompt
* Create a prompt, required fields: - Prompt name - Prompt content - Applicable model Limitations: - Description: 300 characters - Template: 1000 characters - Example: 2000 characters - Tags: 5 - Parameters: 10
* @param promptCreateDTO Information of the prompt to be created (required)
* @return ApiResponse<Long>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public ApiResponse createPromptWithHttpInfo(PromptCreateDTO promptCreateDTO) throws ApiException {
okhttp3.Call localVarCall = createPromptValidateBeforeCall(promptCreateDTO, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create Prompt (asynchronously)
* Create a prompt, required fields: - Prompt name - Prompt content - Applicable model Limitations: - Description: 300 characters - Template: 1000 characters - Example: 2000 characters - Tags: 5 - Parameters: 10
* @param promptCreateDTO Information of the prompt to be created (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call createPromptAsync(PromptCreateDTO promptCreateDTO, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = createPromptValidateBeforeCall(promptCreateDTO, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for createPrompts
* @param promptCreateDTO List of prompt information to be created (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call createPromptsCall(List promptCreateDTO, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = promptCreateDTO;
// create path and map variables
String localVarPath = "/api/v1/prompt/batch";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createPromptsValidateBeforeCall(List promptCreateDTO, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'promptCreateDTO' is set
if (promptCreateDTO == null) {
throw new ApiException("Missing the required parameter 'promptCreateDTO' when calling createPrompts(Async)");
}
return createPromptsCall(promptCreateDTO, _callback);
}
/**
* Batch Create Prompts
* Batch create multiple prompts. Ensure transactionality, return the promptId list after success.
* @param promptCreateDTO List of prompt information to be created (required)
* @return List<Long>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public List createPrompts(List promptCreateDTO) throws ApiException {
ApiResponse> localVarResp = createPromptsWithHttpInfo(promptCreateDTO);
return localVarResp.getData();
}
/**
* Batch Create Prompts
* Batch create multiple prompts. Ensure transactionality, return the promptId list after success.
* @param promptCreateDTO List of prompt information to be created (required)
* @return ApiResponse<List<Long>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public ApiResponse> createPromptsWithHttpInfo(List promptCreateDTO) throws ApiException {
okhttp3.Call localVarCall = createPromptsValidateBeforeCall(promptCreateDTO, null);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Batch Create Prompts (asynchronously)
* Batch create multiple prompts. Ensure transactionality, return the promptId list after success.
* @param promptCreateDTO List of prompt information to be created (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call createPromptsAsync(List promptCreateDTO, final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = createPromptsValidateBeforeCall(promptCreateDTO, _callback);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for deletePrompt
* @param promptId The promptId to be deleted (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call deletePromptCall(Long promptId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v1/prompt/{promptId}"
.replace("{" + "promptId" + "}", localVarApiClient.escapeString(promptId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deletePromptValidateBeforeCall(Long promptId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'promptId' is set
if (promptId == null) {
throw new ApiException("Missing the required parameter 'promptId' when calling deletePrompt(Async)");
}
return deletePromptCall(promptId, _callback);
}
/**
* Delete Prompt
* Delete prompt. Returns success or failure.
* @param promptId The promptId to be deleted (required)
* @return Boolean
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public Boolean deletePrompt(Long promptId) throws ApiException {
ApiResponse localVarResp = deletePromptWithHttpInfo(promptId);
return localVarResp.getData();
}
/**
* Delete Prompt
* Delete prompt. Returns success or failure.
* @param promptId The promptId to be deleted (required)
* @return ApiResponse<Boolean>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public ApiResponse deletePromptWithHttpInfo(Long promptId) throws ApiException {
okhttp3.Call localVarCall = deletePromptValidateBeforeCall(promptId, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Delete Prompt (asynchronously)
* Delete prompt. Returns success or failure.
* @param promptId The promptId to be deleted (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call deletePromptAsync(Long promptId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = deletePromptValidateBeforeCall(promptId, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for deletePromptByName
* @param name The prompt name to be deleted (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call deletePromptByNameCall(String name, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v1/prompt/name/{name}"
.replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deletePromptByNameValidateBeforeCall(String name, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'name' is set
if (name == null) {
throw new ApiException("Missing the required parameter 'name' when calling deletePromptByName(Async)");
}
return deletePromptByNameCall(name, _callback);
}
/**
* Delete Prompt by Name
* Delete prompt by name. return the list of successfully deleted promptIds.
* @param name The prompt name to be deleted (required)
* @return List<Long>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public List deletePromptByName(String name) throws ApiException {
ApiResponse> localVarResp = deletePromptByNameWithHttpInfo(name);
return localVarResp.getData();
}
/**
* Delete Prompt by Name
* Delete prompt by name. return the list of successfully deleted promptIds.
* @param name The prompt name to be deleted (required)
* @return ApiResponse<List<Long>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public ApiResponse> deletePromptByNameWithHttpInfo(String name) throws ApiException {
okhttp3.Call localVarCall = deletePromptByNameValidateBeforeCall(name, null);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Delete Prompt by Name (asynchronously)
* Delete prompt by name. return the list of successfully deleted promptIds.
* @param name The prompt name to be deleted (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call deletePromptByNameAsync(String name, final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = deletePromptByNameValidateBeforeCall(name, _callback);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for deletePrompts
* @param requestBody List of promptIds to be deleted (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call deletePromptsCall(List requestBody, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = requestBody;
// create path and map variables
String localVarPath = "/api/v1/prompt/batch";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deletePromptsValidateBeforeCall(List requestBody, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'requestBody' is set
if (requestBody == null) {
throw new ApiException("Missing the required parameter 'requestBody' when calling deletePrompts(Async)");
}
return deletePromptsCall(requestBody, _callback);
}
/**
* Batch Delete Prompts
* Delete multiple prompts. Ensure transactionality, return the list of successfully deleted promptIds.
* @param requestBody List of promptIds to be deleted (required)
* @return List<Long>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public List deletePrompts(List requestBody) throws ApiException {
ApiResponse> localVarResp = deletePromptsWithHttpInfo(requestBody);
return localVarResp.getData();
}
/**
* Batch Delete Prompts
* Delete multiple prompts. Ensure transactionality, return the list of successfully deleted promptIds.
* @param requestBody List of promptIds to be deleted (required)
* @return ApiResponse<List<Long>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public ApiResponse> deletePromptsWithHttpInfo(List requestBody) throws ApiException {
okhttp3.Call localVarCall = deletePromptsValidateBeforeCall(requestBody, null);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Batch Delete Prompts (asynchronously)
* Delete multiple prompts. Ensure transactionality, return the list of successfully deleted promptIds.
* @param requestBody List of promptIds to be deleted (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call deletePromptsAsync(List requestBody, final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = deletePromptsValidateBeforeCall(requestBody, _callback);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for existsPromptName
* @param name Name (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call existsPromptNameCall(String name, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v1/prompt/exists/name/{name}"
.replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call existsPromptNameValidateBeforeCall(String name, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'name' is set
if (name == null) {
throw new ApiException("Missing the required parameter 'name' when calling existsPromptName(Async)");
}
return existsPromptNameCall(name, _callback);
}
/**
* Check If Prompt Name Exists
* Check if the prompt name already exists.
* @param name Name (required)
* @return Boolean
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public Boolean existsPromptName(String name) throws ApiException {
ApiResponse localVarResp = existsPromptNameWithHttpInfo(name);
return localVarResp.getData();
}
/**
* Check If Prompt Name Exists
* Check if the prompt name already exists.
* @param name Name (required)
* @return ApiResponse<Boolean>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public ApiResponse existsPromptNameWithHttpInfo(String name) throws ApiException {
okhttp3.Call localVarCall = existsPromptNameValidateBeforeCall(name, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Check If Prompt Name Exists (asynchronously)
* Check if the prompt name already exists.
* @param name Name (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call existsPromptNameAsync(String name, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = existsPromptNameValidateBeforeCall(name, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getPromptDetails
* @param promptId PromptId to be obtained (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details