diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 17f688d..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Publish - -on: - push: - tags: - - '[0-9]+.[0-9]+.[0-9]+' - -jobs: - publish: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Set up JDK 1.8 - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: 8 - - - name: Test - run: ./gradlew test - env: - OPENAI_TOKEN: ${{ secrets.OPENAI_TOKEN }} - - - name: Publish - run: ./gradlew build publish - env: - ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} - ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} - ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} - ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index dbf1af2..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Test - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Set up JDK 1.8 - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: 8 - - - name: Test - run: ./gradlew test --stacktrace - env: - OPENAI_TOKEN: ${{ secrets.OPENAI_TOKEN }} diff --git a/api/build.gradle b/api/build.gradle deleted file mode 100644 index 40a7884..0000000 --- a/api/build.gradle +++ /dev/null @@ -1,13 +0,0 @@ -apply plugin: 'java-library' -apply plugin: "com.vanniktech.maven.publish" - -dependencies { - implementation 'com.fasterxml.jackson.core:jackson-annotations:2.9.0' - compileOnly 'org.projectlombok:lombok:1.18.24' - annotationProcessor 'org.projectlombok:lombok:1.18.24' -} - -compileJava { - sourceCompatibility = '1.8' - targetCompatibility = '1.8' -} diff --git a/api/gradle.properties b/api/gradle.properties deleted file mode 100644 index 15f5771..0000000 --- a/api/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -POM_ARTIFACT_ID=api -POM_NAME=api -POM_DESCRIPTION=Basic java objects for the OpenAI GPT-3 API diff --git a/api/src/main/java/com/theokanning/openai/DeleteResult.java b/api/src/main/java/com/theokanning/openai/DeleteResult.java deleted file mode 100644 index 2d8647c..0000000 --- a/api/src/main/java/com/theokanning/openai/DeleteResult.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.theokanning.openai; - -import lombok.Data; - -/** - * A response when deleting an object - */ -@Data -public class DeleteResult { - /** - * The id of the object. - */ - String id; - - /** - * The type of object deleted, for example "file" or "model" - */ - String object; - - /** - * True if successfully deleted - */ - boolean deleted; -} diff --git a/api/src/main/java/com/theokanning/openai/OpenAiResponse.java b/api/src/main/java/com/theokanning/openai/OpenAiResponse.java deleted file mode 100644 index 4b718aa..0000000 --- a/api/src/main/java/com/theokanning/openai/OpenAiResponse.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.theokanning.openai; - -import lombok.Data; - -import java.util.List; - -/** - * A wrapper class to fit the OpenAI engine and search endpoints - */ -@Data -public class OpenAiResponse { - /** - * A list containing the actual results - */ - public List data; - - /** - * The type of object returned, should be "list" - */ - public String object; -} diff --git a/api/src/main/java/com/theokanning/openai/Usage.java b/api/src/main/java/com/theokanning/openai/Usage.java deleted file mode 100644 index 448dc18..0000000 --- a/api/src/main/java/com/theokanning/openai/Usage.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.theokanning.openai; - -import lombok.Data; - -/** - * The OpenAI resources used by a request - */ -@Data -public class Usage { - /** - * The number of prompt tokens used. - */ - long promptTokens; - - /** - * The number of completion tokens used. - */ - long completionTokens; - - /** - * The number of total tokens used - */ - long totalTokens; -} diff --git a/api/src/main/java/com/theokanning/openai/completion/CompletionChoice.java b/api/src/main/java/com/theokanning/openai/completion/CompletionChoice.java deleted file mode 100644 index f46f30e..0000000 --- a/api/src/main/java/com/theokanning/openai/completion/CompletionChoice.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.theokanning.openai.completion; - -import lombok.Data; - -/** - * A completion generated by GPT-3 - * - * https://beta.openai.com/docs/api-reference/completions/create - */ -@Data -public class CompletionChoice { - /** - * The generated text. Will include the prompt if {@link CompletionRequest#echo } is true - */ - String text; - - /** - * This index of this completion in the returned list. - */ - Integer index; - - /** - * The log probabilities of the chosen tokens and the top {@link CompletionRequest#logprobs} tokens - */ - LogProbResult logprobs; - - /** - * The reason why GPT-3 stopped generating, for example "length". - */ - String finish_reason; -} diff --git a/api/src/main/java/com/theokanning/openai/completion/CompletionRequest.java b/api/src/main/java/com/theokanning/openai/completion/CompletionRequest.java deleted file mode 100644 index dc8dc09..0000000 --- a/api/src/main/java/com/theokanning/openai/completion/CompletionRequest.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.theokanning.openai.completion; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; -import java.util.Map; - -/** - * A request for OpenAi to generate a predicted completion for a prompt. - * All fields are nullable. - * - * https://beta.openai.com/docs/api-reference/completions/create - */ -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Data -public class CompletionRequest { - - /** - * The name of the model to use. - * Required if specifying a fine tuned model or if using the new v1/completions endpoint. - */ - String model; - - /** - * An optional prompt to complete from - */ - String prompt; - - /** - * The maximum number of tokens to generate. - * Requests can use up to 2048 tokens shared between prompt and completion. - * (One token is roughly 4 characters for normal English text) - */ - Integer maxTokens; - - /** - * What sampling temperature to use. Higher values means the model will take more risks. - * Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer. - * - * We generally recommend using this or {@link CompletionRequest#topP} but not both. - */ - Double temperature; - - /** - * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of - * the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are - * considered. - * - * We generally recommend using this or {@link CompletionRequest#temperature} but not both. - */ - Double topP; - - /** - * How many completions to generate for each prompt. - * - * Because this parameter generates many completions, it can quickly consume your token quota. - * Use carefully and ensure that you have reasonable settings for {@link CompletionRequest#maxTokens} and {@link CompletionRequest#stop}. - */ - Integer n; - - /** - * Whether to stream back partial progress. - * If set, tokens will be sent as data-only server-sent events as they become available, - * with the stream terminated by a data: DONE message. - */ - Boolean stream; - - /** - * Include the log probabilities on the logprobs most likely tokens, as well the chosen tokens. - * For example, if logprobs is 10, the API will return a list of the 10 most likely tokens. - * The API will always return the logprob of the sampled token, - * so there may be up to logprobs+1 elements in the response. - */ - Integer logprobs; - - /** - * Echo back the prompt in addition to the completion - */ - Boolean echo; - - /** - * Up to 4 sequences where the API will stop generating further tokens. - * The returned text will not contain the stop sequence. - */ - List stop; - - /** - * Number between 0 and 1 (default 0) that penalizes new tokens based on whether they appear in the text so far. - * Increases the model's likelihood to talk about new topics. - */ - Double presencePenalty; - - /** - * Number between 0 and 1 (default 0) that penalizes new tokens based on their existing frequency in the text so far. - * Decreases the model's likelihood to repeat the same line verbatim. - */ - Double frequencyPenalty; - - /** - * Generates best_of completions server-side and returns the "best" - * (the one with the lowest log probability per token). - * Results cannot be streamed. - * - * When used with {@link CompletionRequest#n}, best_of controls the number of candidate completions and n specifies how many to return, - * best_of must be greater than n. - */ - Integer bestOf; - - /** - * Modify the likelihood of specified tokens appearing in the completion. - * - * Maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. - * - * https://beta.openai.com/docs/api-reference/completions/create#completions/create-logit_bias - */ - Map logitBias; - - /** - * A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. - */ - String user; -} diff --git a/api/src/main/java/com/theokanning/openai/completion/CompletionResult.java b/api/src/main/java/com/theokanning/openai/completion/CompletionResult.java deleted file mode 100644 index b43e420..0000000 --- a/api/src/main/java/com/theokanning/openai/completion/CompletionResult.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.theokanning.openai.completion; - -import com.theokanning.openai.Usage; -import lombok.Data; - -import java.util.List; - -/** - * An object containing a response from the completion api - * - * https://beta.openai.com/docs/api-reference/completions/create - */ -@Data -public class CompletionResult { - /** - * A unique id assigned to this completion. - */ - String id; - - /** - * The type of object returned, should be "text_completion" - */ - String object; - - /** - * The creation time in epoch seconds. - */ - long created; - - /** - * The GPT-3 model used. - */ - String model; - - /** - * A list of generated completions. - */ - List choices; - - /** - * The API usage for this request - */ - Usage usage; -} diff --git a/api/src/main/java/com/theokanning/openai/completion/LogProbResult.java b/api/src/main/java/com/theokanning/openai/completion/LogProbResult.java deleted file mode 100644 index 90ff87a..0000000 --- a/api/src/main/java/com/theokanning/openai/completion/LogProbResult.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.theokanning.openai.completion; - -import lombok.Data; - -import java.util.List; -import java.util.Map; - -/** - * Log probabilities of different token options - * Returned if {@link CompletionRequest#logprobs} is greater than zero - * - * https://beta.openai.com/docs/api-reference/create-completion - */ -@Data -public class LogProbResult { - - /** - * The tokens chosen by the completion api - */ - List tokens; - - /** - * The log probability of each token in {@link tokens} - */ - List tokenLogprobs; - - /** - * A map for each index in the completion result. - * The map contains the top {@link CompletionRequest#logprobs} tokens and their probabilities - */ - List> topLogprobs; - - /** - * The character offset from the start of the returned text for each of the chosen tokens. - */ - List textOffset; -} diff --git a/api/src/main/java/com/theokanning/openai/edit/EditChoice.java b/api/src/main/java/com/theokanning/openai/edit/EditChoice.java deleted file mode 100644 index bde7892..0000000 --- a/api/src/main/java/com/theokanning/openai/edit/EditChoice.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.theokanning.openai.edit; - -import lombok.Data; - -/** - * An edit generated by GPT-3 - * - * https://beta.openai.com/docs/api-reference/edits/create - */ -@Data -public class EditChoice { - - /** - * The edited text. - */ - String text; - - /** - * This index of this completion in the returned list. - */ - Integer index; -} diff --git a/api/src/main/java/com/theokanning/openai/edit/EditRequest.java b/api/src/main/java/com/theokanning/openai/edit/EditRequest.java deleted file mode 100644 index b84ecdc..0000000 --- a/api/src/main/java/com/theokanning/openai/edit/EditRequest.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.theokanning.openai.edit; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.*; - -/** - * Given a prompt and an instruction, OpenAi will return an edited version of the prompt - * - * https://beta.openai.com/docs/api-reference/edits/create - */ -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Data -public class EditRequest { - - /** - * The name of the model to use. - * Required if using the new v1/edits endpoint. - */ - String model; - - /** - * The input text to use as a starting point for the edit. - */ - String input; - - /** - * The instruction that tells the model how to edit the prompt. - * For example, "Fix the spelling mistakes" - */ - @NonNull - String instruction; - - /** - * How many edits to generate for the input and instruction. - */ - Integer n; - - /** - * What sampling temperature to use. Higher values means the model will take more risks. - * Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer. - * - * We generally recommend altering this or {@link EditRequest#topP} but not both. - */ - Double temperature; - - /** - * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of - * the tokens with top_p probability mass.So 0.1 means only the tokens comprising the top 10% probability mass are - * considered. - * - * We generally recommend altering this or {@link EditRequest#temperature} but not both. - */ - @JsonProperty("top_p") - Double topP; -} diff --git a/api/src/main/java/com/theokanning/openai/edit/EditResult.java b/api/src/main/java/com/theokanning/openai/edit/EditResult.java deleted file mode 100644 index 415ba74..0000000 --- a/api/src/main/java/com/theokanning/openai/edit/EditResult.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.theokanning.openai.edit; - -import com.theokanning.openai.Usage; -import lombok.Data; - -import java.util.List; - -/** - * A list of edits generated by GPT-3 - * - * https://beta.openai.com/docs/api-reference/edits/create - */ -@Data -public class EditResult { - - /** - * The type of object returned, should be "edit" - */ - public String object; - - /** - * The creation time in epoch milliseconds. - */ - public long created; - - /** - * A list of generated edits. - */ - public List choices; - - /** - * The API usage for this request - */ - public Usage usage; -} diff --git a/api/src/main/java/com/theokanning/openai/edit/EditUsage.java b/api/src/main/java/com/theokanning/openai/edit/EditUsage.java deleted file mode 100644 index 7223890..0000000 --- a/api/src/main/java/com/theokanning/openai/edit/EditUsage.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.theokanning.openai.edit; - -import lombok.Data; - -/** - * An object containing the API usage for an edit request - * - * Deprecated, use {@link com.theokanning.openai.Usage} instead - * - * https://beta.openai.com/docs/api-reference/edits/create - */ -@Data -@Deprecated -public class EditUsage { - - /** - * The number of prompt tokens consumed. - */ - String promptTokens; - - /** - * The number of completion tokens consumed. - */ - String completionTokens; - - /** - * The number of total tokens consumed. - */ - String totalTokens; -} diff --git a/api/src/main/java/com/theokanning/openai/embedding/Embedding.java b/api/src/main/java/com/theokanning/openai/embedding/Embedding.java deleted file mode 100644 index 5fc423f..0000000 --- a/api/src/main/java/com/theokanning/openai/embedding/Embedding.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.theokanning.openai.embedding; - -import lombok.Data; - -import java.util.List; - -/** - * Represents an embedding returned by the embedding api - * - * https://beta.openai.com/docs/api-reference/classifications/create - */ -@Data -public class Embedding { - - /** - * The type of object returned, should be "embedding" - */ - String object; - - /** - * The embedding vector - */ - List embedding; - - /** - * The position of this embedding in the list - */ - Integer index; -} diff --git a/api/src/main/java/com/theokanning/openai/embedding/EmbeddingRequest.java b/api/src/main/java/com/theokanning/openai/embedding/EmbeddingRequest.java deleted file mode 100644 index d52014d..0000000 --- a/api/src/main/java/com/theokanning/openai/embedding/EmbeddingRequest.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.theokanning.openai.embedding; - -import lombok.*; - -import java.util.List; - -/** - * Creates an embedding vector representing the input text. - * - * https://beta.openai.com/docs/api-reference/embeddings/create - */ -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Data -public class EmbeddingRequest { - - /** - * The name of the model to use. - * Required if using the new v1/embeddings endpoint. - */ - String model; - - /** - * Input text to get embeddings for, encoded as a string or array of tokens. - * To get embeddings for multiple inputs in a single request, pass an array of strings or array of token arrays. - * Each input must not exceed 2048 tokens in length. - *

- * Unless your are embedding code, we suggest replacing newlines (\n) in your input with a single space, - * as we have observed inferior results when newlines are present. - */ - @NonNull - List input; - - /** - * A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. - */ - String user; -} diff --git a/api/src/main/java/com/theokanning/openai/embedding/EmbeddingResult.java b/api/src/main/java/com/theokanning/openai/embedding/EmbeddingResult.java deleted file mode 100644 index 58d9b9c..0000000 --- a/api/src/main/java/com/theokanning/openai/embedding/EmbeddingResult.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.theokanning.openai.embedding; - -import com.theokanning.openai.Usage; -import lombok.Data; - -import java.util.List; - -/** - * An object containing a response from the answer api - * - * https://beta.openai.com/docs/api-reference/embeddings/create - */ -@Data -public class EmbeddingResult { - - /** - * The GPT-3 model used for generating embeddings - */ - String model; - - /** - * The type of object returned, should be "list" - */ - String object; - - /** - * A list of the calculated embeddings - */ - List data; - - /** - * The API usage for this request - */ - Usage usage; -} diff --git a/api/src/main/java/com/theokanning/openai/engine/Engine.java b/api/src/main/java/com/theokanning/openai/engine/Engine.java deleted file mode 100644 index 1aa542a..0000000 --- a/api/src/main/java/com/theokanning/openai/engine/Engine.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.theokanning.openai.engine; - -import lombok.Data; - -/** - * GPT-3 engine details - * - * https://beta.openai.com/docs/api-reference/retrieve-engine - */ -@Deprecated -@Data -public class Engine { - /** - * An identifier for this engine, used to specify an engine for completions or searching. - */ - public String id; - - /** - * The type of object returned, should be "engine" - */ - public String object; - - /** - * The owner of the GPT-3 engine, typically "openai" - */ - public String owner; - - /** - * Whether the engine is ready to process requests or not - */ - public boolean ready; -} diff --git a/api/src/main/java/com/theokanning/openai/file/File.java b/api/src/main/java/com/theokanning/openai/file/File.java deleted file mode 100644 index 2882e0b..0000000 --- a/api/src/main/java/com/theokanning/openai/file/File.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.theokanning.openai.file; - -import lombok.Data; - -/** - * A file uploaded to OpenAi - * - * https://beta.openai.com/docs/api-reference/files - */ -@Data -public class File { - - /** - * The unique id of this file. - */ - String id; - - /** - * The type of object returned, should be "file". - */ - String object; - - /** - * File size in bytes. - */ - Long bytes; - - /** - * The creation time in epoch seconds. - */ - Long createdAt; - - /** - * The name of the file. - */ - String filename; - - /** - * Description of the file's purpose. - */ - String purpose; -} diff --git a/api/src/main/java/com/theokanning/openai/finetune/FineTuneEvent.java b/api/src/main/java/com/theokanning/openai/finetune/FineTuneEvent.java deleted file mode 100644 index ccf6d37..0000000 --- a/api/src/main/java/com/theokanning/openai/finetune/FineTuneEvent.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.theokanning.openai.finetune; - -import lombok.Data; - -/** - * An object representing an event in the lifecycle of a fine-tuning job - * - * https://beta.openai.com/docs/api-reference/fine-tunes - */ -@Data -public class FineTuneEvent { - /** - * The type of object returned, should be "fine-tune-event". - */ - String object; - - /** - * The creation time in epoch seconds. - */ - Long createdAt; - - /** - * The log level of this message. - */ - String level; - - /** - * The event message. - */ - String message; -} diff --git a/api/src/main/java/com/theokanning/openai/finetune/FineTuneRequest.java b/api/src/main/java/com/theokanning/openai/finetune/FineTuneRequest.java deleted file mode 100644 index a992cf1..0000000 --- a/api/src/main/java/com/theokanning/openai/finetune/FineTuneRequest.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.theokanning.openai.finetune; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.*; - -import java.util.List; - -/** - * A request for OpenAi to create a fine-tuned model - * All fields except trainingFile are nullable. - * - * https://beta.openai.com/docs/api-reference/fine-tunes/create - */ -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Data -public class FineTuneRequest { - - /** - * The ID of an uploaded file that contains training data. - */ - @NonNull - String trainingFile; - - /** - * The ID of an uploaded file that contains validation data. - */ - String validationFile; - - /** - * The name of the base model to fine-tune. You can select one of "ada", "babbage", "curie", or "davinci". - * To learn more about these models, see the Engines documentation. - */ - String model; - - /** - * The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. - */ - Integer nEpochs; - - /** - * The batch size to use for training. - * The batch size is the number of training examples used to train a single forward and backward pass. - * - * By default, the batch size will be dynamically configured to be ~0.2% of the number of examples in the training - * set, capped at 256 - in general, we've found that larger batch sizes tend to work better for larger datasets. - */ - Integer batchSize; - - /** - * The learning rate multiplier to use for training. - * The fine-tuning learning rate is the original learning rate used for pretraining multiplied by this value. - * - * By default, the learning rate multiplier is the 0.05, 0.1, or 0.2 depending on final batch_size - * (larger learning rates tend to perform better with larger batch sizes). - * We recommend experimenting with values in the range 0.02 to 0.2 to see what produces the best results. - */ - Double learningRateMultiplier; - - /** - * The weight to use for loss on the prompt tokens. - * This controls how much the model tries to learn to generate the prompt - * (as compared to the completion which always has a weight of 1.0), - * and can add a stabilizing effect to training when completions are short. - * - * If prompts are extremely long (relative to completions), it may make sense to reduce this weight so as to - * avoid over-prioritizing learning the prompt. - */ - Double promptLossWeight; - - /** - * If set, we calculate classification-specific metrics such as accuracy and F-1 score using the validation set - * at the end of every epoch. These metrics can be viewed in the results file. - * - * In order to compute classification metrics, you must provide a validation_file. - * Additionally, you must specify {@link FineTuneRequest#classificationNClasses} for multiclass - * classification or {@link FineTuneRequest#classificationPositiveClass} for binary classification. - */ - Boolean computeClassificationMetrics; - - /** - * The number of classes in a classification task. - * - * This parameter is required for multiclass classification. - */ - @JsonProperty("classification_n_classes") - Integer classificationNClasses; - - /** - * The positive class in binary classification. - * - * This parameter is needed to generate precision, recall, and F1 metrics when doing binary classification. - */ - String classificationPositiveClass; - - /** - * If this is provided, we calculate F-beta scores at the specified beta values. - * The F-beta score is a generalization of F-1 score. This is only used for binary classification. - * - * With a beta of 1 (i.e. the F-1 score), precision and recall are given the same weight. - * A larger beta score puts more weight on recall and less on precision. - * A smaller beta score puts more weight on precision and less on recall. - */ - List classificationBetas; - - /** - * A string of up to 40 characters that will be added to your fine-tuned model name. - */ - String suffix; -} diff --git a/api/src/main/java/com/theokanning/openai/finetune/FineTuneResult.java b/api/src/main/java/com/theokanning/openai/finetune/FineTuneResult.java deleted file mode 100644 index 27e2b6d..0000000 --- a/api/src/main/java/com/theokanning/openai/finetune/FineTuneResult.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.theokanning.openai.finetune; - -import com.theokanning.openai.file.File; -import lombok.Data; - -import java.util.List; - -/** - * An object describing a fine-tuned model. Returned by multiple fine-tune requests. - * - * https://beta.openai.com/docs/api-reference/fine-tunes - */ -@Data -public class FineTuneResult { - /** - * The ID of the fine-tuning job. - */ - String id; - - /** - * The type of object returned, should be "fine-tune". - */ - String object; - - /** - * The name of the base model. - */ - String model; - - /** - * The creation time in epoch seconds. - */ - Long createdAt; - - /** - * List of events in this job's lifecycle. Null when getting a list of fine-tune jobs. - */ - List events; - - /** - * The ID of the fine-tuned model, null if tuning job is not finished. - * This is the id used to call the model. - */ - String fineTunedModel; - - /** - * The specified hyper-parameters for the tuning job. - */ - HyperParameters hyperparams; - - /** - * The ID of the organization this model belongs to. - */ - String organizationId; - - /** - * Result files for this fine-tune job. - */ - List resultFiles; - - /** - * The status os the fine-tune job. "pending", "succeeded", or "cancelled" - */ - String status; - - /** - * Training files for this fine-tune job. - */ - List trainingFiles; - - /** - * The last update time in epoch seconds. - */ - Long updatedAt; - - /** - * Validation files for this fine-tune job. - */ - List validationFiles; -} diff --git a/api/src/main/java/com/theokanning/openai/finetune/HyperParameters.java b/api/src/main/java/com/theokanning/openai/finetune/HyperParameters.java deleted file mode 100644 index 94e82e9..0000000 --- a/api/src/main/java/com/theokanning/openai/finetune/HyperParameters.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.theokanning.openai.finetune; - -import lombok.Data; - -/** - * Fine-tuning job hyperparameters - * - * https://beta.openai.com/docs/api-reference/fine-tunes - */ -@Data -public class HyperParameters { - - /** - * The batch size to use for training. - */ - String batchSize; - - /** - * The learning rate multiplier to use for training. - */ - Double learningRateMultiplier; - - /** - * The number of epochs to train the model for. - */ - Integer nEpochs; - - /** - * The weight to use for loss on the prompt tokens. - */ - Double promptLossWeight; -} diff --git a/api/src/main/java/com/theokanning/openai/image/CreateImageEditRequest.java b/api/src/main/java/com/theokanning/openai/image/CreateImageEditRequest.java deleted file mode 100644 index ec4f55a..0000000 --- a/api/src/main/java/com/theokanning/openai/image/CreateImageEditRequest.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.theokanning.openai.image; - -import lombok.*; - -/** - * A request for OpenAi to edit an image based on a prompt - * All fields except prompt are optional - * - * https://beta.openai.com/docs/api-reference/images/create-edit - */ -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Data -public class CreateImageEditRequest { - - /** - * A text description of the desired image(s). The maximum length in 1000 characters. - */ - @NonNull - String prompt; - - /** - * The number of images to generate. Must be between 1 and 10. Defaults to 1. - */ - Integer n; - - /** - * The size of the generated images. Must be one of "256x256", "512x512", or "1024x1024". Defaults to "1024x1024". - */ - String size; - - /** - * The format in which the generated images are returned. Must be one of url or b64_json. Defaults to url. - */ - String responseFormat; - - /** - * A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. - */ - String user; -} diff --git a/api/src/main/java/com/theokanning/openai/image/CreateImageRequest.java b/api/src/main/java/com/theokanning/openai/image/CreateImageRequest.java deleted file mode 100644 index 8e94d82..0000000 --- a/api/src/main/java/com/theokanning/openai/image/CreateImageRequest.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.theokanning.openai.image; - -import lombok.*; - -/** - * A request for OpenAi to create an image based on a prompt - * All fields except prompt are optional - * - * https://beta.openai.com/docs/api-reference/images/create - */ -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Data -public class CreateImageRequest { - - /** - * A text description of the desired image(s). The maximum length in 1000 characters. - */ - @NonNull - String prompt; - - /** - * The number of images to generate. Must be between 1 and 10. Defaults to 1. - */ - Integer n; - - /** - * The size of the generated images. Must be one of "256x256", "512x512", or "1024x1024". Defaults to "1024x1024". - */ - String size; - - /** - * The format in which the generated images are returned. Must be one of url or b64_json. Defaults to url. - */ - String responseFormat; - - /** - * A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. - */ - String user; -} diff --git a/api/src/main/java/com/theokanning/openai/image/CreateImageVariationRequest.java b/api/src/main/java/com/theokanning/openai/image/CreateImageVariationRequest.java deleted file mode 100644 index 6798dba..0000000 --- a/api/src/main/java/com/theokanning/openai/image/CreateImageVariationRequest.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.theokanning.openai.image; - -import lombok.*; - -/** - * A request for OpenAi to create a variation of an image - * All fields are optional - * - * https://beta.openai.com/docs/api-reference/images/create-variation - */ -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Data -public class CreateImageVariationRequest { - - /** - * The number of images to generate. Must be between 1 and 10. Defaults to 1. - */ - Integer n; - - /** - * The size of the generated images. Must be one of "256x256", "512x512", or "1024x1024". Defaults to "1024x1024". - */ - String size; - - /** - * The format in which the generated images are returned. Must be one of url or b64_json. Defaults to url. - */ - String responseFormat; - - /** - * A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. - */ - String user; -} diff --git a/api/src/main/java/com/theokanning/openai/image/Image.java b/api/src/main/java/com/theokanning/openai/image/Image.java deleted file mode 100644 index e321484..0000000 --- a/api/src/main/java/com/theokanning/openai/image/Image.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.theokanning.openai.image; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.Data; - -/** - * An object containing either a URL or a base 64 encoded image. - * - * https://beta.openai.com/docs/api-reference/images - */ -@Data -public class Image { - /** - * The URL where the image can be accessed. - */ - String url; - - - /** - * Base64 encoded image string. - */ - @JsonProperty("b64_json") - String b64Json; -} diff --git a/api/src/main/java/com/theokanning/openai/image/ImageResult.java b/api/src/main/java/com/theokanning/openai/image/ImageResult.java deleted file mode 100644 index dc0b5ab..0000000 --- a/api/src/main/java/com/theokanning/openai/image/ImageResult.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.theokanning.openai.image; - -import lombok.Data; - -import java.util.List; - -/** - * An object with a list of image results. - * - * https://beta.openai.com/docs/api-reference/images - */ -@Data -public class ImageResult { - - /** - * The creation time in epoch seconds. - */ - Long createdAt; - - /** - * List of image results. - */ - List data; -} diff --git a/api/src/main/java/com/theokanning/openai/model/Model.java b/api/src/main/java/com/theokanning/openai/model/Model.java deleted file mode 100644 index 829ac5f..0000000 --- a/api/src/main/java/com/theokanning/openai/model/Model.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.theokanning.openai.model; - -import lombok.Data; - -import java.util.List; - -/** - * GPT-3 model details - * - * https://beta.openai.com/docs/api-reference/models - */ -@Data -public class Model { - /** - * An identifier for this model, used to specify the model when making completions, etc - */ - public String id; - - /** - * The type of object returned, should be "model" - */ - public String object; - - /** - * The owner of the GPT-3 model, typically "openai" - */ - public String ownedBy; - - /** - * List of permissions for this model - */ - public List permission; - - /** - * The root model that this and its parent (if applicable) are based on - */ - public String root; - - /** - * The parent model that this is based on - */ - public String parent; -} diff --git a/api/src/main/java/com/theokanning/openai/model/Permission.java b/api/src/main/java/com/theokanning/openai/model/Permission.java deleted file mode 100644 index 416df7f..0000000 --- a/api/src/main/java/com/theokanning/openai/model/Permission.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.theokanning.openai.model; - -import lombok.Data; - -/** - * GPT-3 model permissions - * I couldn't find documentation for the specific permissions, and I've elected to leave them undocumented rather than - * write something incorrect. - * - * https://beta.openai.com/docs/api-reference/models - */ -@Data -public class Permission { - /** - * An identifier for this model permission - */ - public String id; - - /** - * The type of object returned, should be "model_permission" - */ - public String object; - - /** - * The creation time in epoch seconds. - */ - public long created; - - public boolean allowCreateEngine; - - public boolean allowSampling; - - public boolean allowLogProbs; - - public boolean allowSearchIndices; - - public boolean allowView; - - public boolean allowFineTuning; - - public String organization; - - public String group; - - public boolean isBlocking; - -} diff --git a/api/src/main/java/com/theokanning/openai/moderation/Moderation.java b/api/src/main/java/com/theokanning/openai/moderation/Moderation.java deleted file mode 100644 index b638c82..0000000 --- a/api/src/main/java/com/theokanning/openai/moderation/Moderation.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.theokanning.openai.moderation; - -import lombok.Data; - -/** - * An object containing the moderation data for a single input string - * - * https://beta.openai.com/docs/api-reference/moderations/create - */ -@Data -public class Moderation { - /** - * Set to true if the model classifies the content as violating OpenAI's content policy, false otherwise - */ - public boolean flagged; - - /** - * Object containing per-category binary content policy violation flags. - * For each category, the value is true if the model flags the corresponding category as violated, false otherwise. - */ - public ModerationCategories categories; - - /** - * Object containing per-category raw scores output by the model, denoting the model's confidence that the - * input violates the OpenAI's policy for the category. - * The value is between 0 and 1, where higher values denote higher confidence. - * The scores should not be interpreted as probabilities. - */ - public ModerationCategoryScores categoryScores; -} diff --git a/api/src/main/java/com/theokanning/openai/moderation/ModerationCategories.java b/api/src/main/java/com/theokanning/openai/moderation/ModerationCategories.java deleted file mode 100644 index 585109b..0000000 --- a/api/src/main/java/com/theokanning/openai/moderation/ModerationCategories.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.theokanning.openai.moderation; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.theokanning.openai.completion.CompletionChoice; -import lombok.Data; - -import java.util.List; - -/** - * An object containing the flags for each moderation category - * - * https://beta.openai.com/docs/api-reference/moderations/create - */ -@Data -public class ModerationCategories { - - public boolean hate; - - @JsonProperty("hate/threatening") - public boolean hateThreatening; - - @JsonProperty("self-harm") - public boolean selfHarm; - - public boolean sexual; - - @JsonProperty("sexual/minors") - public boolean sexualMinors; - - public boolean violence; - - @JsonProperty("violence/graphic") - public boolean violenceGraphic; -} diff --git a/api/src/main/java/com/theokanning/openai/moderation/ModerationCategoryScores.java b/api/src/main/java/com/theokanning/openai/moderation/ModerationCategoryScores.java deleted file mode 100644 index 94e056a..0000000 --- a/api/src/main/java/com/theokanning/openai/moderation/ModerationCategoryScores.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.theokanning.openai.moderation; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.Data; - -/** - * An object containing the scores for each moderation category - * - * https://beta.openai.com/docs/api-reference/moderations/create - */ -@Data -public class ModerationCategoryScores { - - public double hate; - - @JsonProperty("hate/threatening") - public double hateThreatening; - - @JsonProperty("self-harm") - public double selfHarm; - - public double sexual; - - @JsonProperty("sexual/minors") - public double sexualMinors; - - public double violence; - - @JsonProperty("violence/graphic") - public double violenceGraphic; -} diff --git a/api/src/main/java/com/theokanning/openai/moderation/ModerationRequest.java b/api/src/main/java/com/theokanning/openai/moderation/ModerationRequest.java deleted file mode 100644 index 6e51e46..0000000 --- a/api/src/main/java/com/theokanning/openai/moderation/ModerationRequest.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.theokanning.openai.moderation; - -import lombok.*; - -import java.util.List; - -/** - * A request for OpenAi to detect if text violates OpenAi's content policy. - * - * https://beta.openai.com/docs/api-reference/moderations/create - */ -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Data -public class ModerationRequest { - - /** - * The input text to classify. - */ - @NonNull - String input; - - /** - * The name of the model to use, defaults to text-moderation-stable. - */ - String model; -} diff --git a/api/src/main/java/com/theokanning/openai/moderation/ModerationResult.java b/api/src/main/java/com/theokanning/openai/moderation/ModerationResult.java deleted file mode 100644 index 3b9190c..0000000 --- a/api/src/main/java/com/theokanning/openai/moderation/ModerationResult.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.theokanning.openai.moderation; - -import lombok.Data; - -import java.util.List; - -/** - * An object containing a response from the moderation api - * - * https://beta.openai.com/docs/api-reference/moderations/create - */ -@Data -public class ModerationResult { - /** - * A unique id assigned to this moderation. - */ - public String id; - - /** - * The GPT-3 model used. - */ - public String model; - - /** - * A list of moderation scores. - */ - public List results; -} diff --git a/client/build.gradle b/client/build.gradle deleted file mode 100644 index 538632a..0000000 --- a/client/build.gradle +++ /dev/null @@ -1,21 +0,0 @@ -apply plugin: 'java-library' -apply plugin: "com.vanniktech.maven.publish" - -dependencies { - api project(":api") - api 'com.squareup.retrofit2:retrofit:2.9.0' - implementation 'com.squareup.retrofit2:adapter-rxjava2:2.9.0' - implementation 'com.squareup.retrofit2:converter-jackson:2.9.0' - - testImplementation(platform('org.junit:junit-bom:5.8.2')) - testImplementation('org.junit.jupiter:junit-jupiter') -} - -compileJava { - sourceCompatibility = '1.8' - targetCompatibility = '1.8' -} - -test { - useJUnitPlatform() -} diff --git a/client/gradle.properties b/client/gradle.properties deleted file mode 100644 index 94fab2a..0000000 --- a/client/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -POM_ARTIFACT_ID=client -POM_NAME=client -POM_DESCRIPTION=Basic retrofit client for OpenAI's GPT-3 API diff --git a/client/src/main/java/com/theokanning/openai/AuthenticationInterceptor.java b/client/src/main/java/com/theokanning/openai/AuthenticationInterceptor.java deleted file mode 100644 index 7e53c6a..0000000 --- a/client/src/main/java/com/theokanning/openai/AuthenticationInterceptor.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.theokanning.openai; - -import okhttp3.Interceptor; -import okhttp3.Request; -import okhttp3.Response; - -import java.io.IOException; - -/** - * OkHttp Interceptor that adds an authorization token header - */ -public class AuthenticationInterceptor implements Interceptor { - - private final String token; - - AuthenticationInterceptor(String token) { - this.token = token; - } - - @Override - public Response intercept(Chain chain) throws IOException { - Request request = chain.request() - .newBuilder() - .header("Authorization", "Bearer " + token) - .build(); - return chain.proceed(request); - } -} diff --git a/client/src/main/java/com/theokanning/openai/OpenAiApi.java b/client/src/main/java/com/theokanning/openai/OpenAiApi.java deleted file mode 100644 index be6a648..0000000 --- a/client/src/main/java/com/theokanning/openai/OpenAiApi.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.theokanning.openai; - -import com.theokanning.openai.completion.CompletionRequest; -import com.theokanning.openai.completion.CompletionResult; -import com.theokanning.openai.edit.EditRequest; -import com.theokanning.openai.edit.EditResult; -import com.theokanning.openai.embedding.EmbeddingRequest; -import com.theokanning.openai.embedding.EmbeddingResult; -import com.theokanning.openai.engine.Engine; -import com.theokanning.openai.file.File; -import com.theokanning.openai.finetune.FineTuneEvent; -import com.theokanning.openai.finetune.FineTuneRequest; -import com.theokanning.openai.finetune.FineTuneResult; -import com.theokanning.openai.image.CreateImageEditRequest; -import com.theokanning.openai.image.CreateImageRequest; -import com.theokanning.openai.image.ImageResult; -import com.theokanning.openai.model.Model; -import com.theokanning.openai.moderation.ModerationRequest; -import com.theokanning.openai.moderation.ModerationResult; -import io.reactivex.Single; -import okhttp3.MultipartBody; -import okhttp3.RequestBody; -import retrofit2.http.*; - -public interface OpenAiApi { - - @GET("v1/models") - Single> listModels(); - - @GET("/v1/models/{model_id}") - Single getModel(@Path("model_id") String modelId); - - @POST("/v1/completions") - Single createCompletion(@Body CompletionRequest request); - - @Deprecated - @POST("/v1/engines/{engine_id}/completions") - Single createCompletion(@Path("engine_id") String engineId, @Body CompletionRequest request); - - @POST("/v1/edits") - Single createEdit(@Body EditRequest request); - - @Deprecated - @POST("/v1/engines/{engine_id}/edits") - Single createEdit(@Path("engine_id") String engineId, @Body EditRequest request); - - @POST("/v1/embeddings") - Single createEmbeddings(@Body EmbeddingRequest request); - - @Deprecated - @POST("/v1/engines/{engine_id}/embeddings") - Single createEmbeddings(@Path("engine_id") String engineId, @Body EmbeddingRequest request); - - @GET("/v1/files") - Single> listFiles(); - - @Multipart - @POST("/v1/files") - Single uploadFile(@Part("purpose") RequestBody purpose, @Part MultipartBody.Part file); - - @DELETE("/v1/files/{file_id}") - Single deleteFile(@Path("file_id") String fileId); - - @GET("/v1/files/{file_id}") - Single retrieveFile(@Path("file_id") String fileId); - - @POST("/v1/fine-tunes") - Single createFineTune(@Body FineTuneRequest request); - - @POST("/v1/completions") - Single createFineTuneCompletion(@Body CompletionRequest request); - - @GET("/v1/fine-tunes") - Single> listFineTunes(); - - @GET("/v1/fine-tunes/{fine_tune_id}") - Single retrieveFineTune(@Path("fine_tune_id") String fineTuneId); - - @POST("/v1/fine-tunes/{fine_tune_id}/cancel") - Single cancelFineTune(@Path("fine_tune_id") String fineTuneId); - - @GET("/v1/fine-tunes/{fine_tune_id}/events") - Single> listFineTuneEvents(@Path("fine_tune_id") String fineTuneId); - - @DELETE("/v1/models/{fine_tune_id}") - Single deleteFineTune(@Path("fine_tune_id") String fineTuneId); - - @POST("/v1/images/generations") - Single createImage(@Body CreateImageRequest request); - - @POST("/v1/images/edits") - Single createImageEdit(@Body RequestBody requestBody); - - @POST("/v1/images/variations") - Single createImageVariation(@Body RequestBody requestBody); - - @POST("/v1/moderations") - Single createModeration(@Body ModerationRequest request); - - @Deprecated - @GET("v1/engines") - Single> getEngines(); - - @Deprecated - @GET("/v1/engines/{engine_id}") - Single getEngine(@Path("engine_id") String engineId); -} diff --git a/client/src/main/java/com/theokanning/openai/OpenAiService.java b/client/src/main/java/com/theokanning/openai/OpenAiService.java deleted file mode 100644 index 444f7e2..0000000 --- a/client/src/main/java/com/theokanning/openai/OpenAiService.java +++ /dev/null @@ -1,242 +0,0 @@ -package com.theokanning.openai; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.PropertyNamingStrategy; -import com.theokanning.openai.completion.CompletionRequest; -import com.theokanning.openai.completion.CompletionResult; -import com.theokanning.openai.edit.EditRequest; -import com.theokanning.openai.edit.EditResult; -import com.theokanning.openai.embedding.EmbeddingRequest; -import com.theokanning.openai.embedding.EmbeddingResult; -import com.theokanning.openai.engine.Engine; -import com.theokanning.openai.file.File; -import com.theokanning.openai.finetune.FineTuneEvent; -import com.theokanning.openai.finetune.FineTuneRequest; -import com.theokanning.openai.finetune.FineTuneResult; -import com.theokanning.openai.image.*; -import com.theokanning.openai.model.Model; -import com.theokanning.openai.moderation.ModerationRequest; -import com.theokanning.openai.moderation.ModerationResult; -import okhttp3.*; -import retrofit2.Retrofit; -import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; -import retrofit2.converter.jackson.JacksonConverterFactory; - -import java.util.List; -import java.util.concurrent.TimeUnit; - -public class OpenAiService { - - OpenAiApi api; - - /** - * Creates a new OpenAiService that wraps OpenAiApi - * - * @param token OpenAi token string "sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" - */ - public OpenAiService(String token) { - this(token, 10); - } - - /** - * Creates a new OpenAiService that wraps OpenAiApi - * - * @param token OpenAi token string "sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" - * @param timeout http read timeout in seconds, 0 means no timeout - */ - public OpenAiService(String token, int timeout) { - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE); - - OkHttpClient client = new OkHttpClient.Builder() - .addInterceptor(new AuthenticationInterceptor(token)) - .connectionPool(new ConnectionPool(5, 1, TimeUnit.SECONDS)) - .readTimeout(timeout, TimeUnit.SECONDS) - .build(); - - Retrofit retrofit = new Retrofit.Builder() - .baseUrl("https://api.openai.com/") - .client(client) - .addConverterFactory(JacksonConverterFactory.create(mapper)) - .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) - .build(); - - this.api = retrofit.create(OpenAiApi.class); - } - - /** - * Creates a new OpenAiService that wraps OpenAiApi - * - * @param api OpenAiApi instance to use for all methods - */ - public OpenAiService(OpenAiApi api) { - this.api = api; - } - - public List listModels() { - return api.listModels().blockingGet().data; - } - - public Model getModel(String modelId) { - return api.getModel(modelId).blockingGet(); - } - - public CompletionResult createCompletion(CompletionRequest request) { - return api.createCompletion(request).blockingGet(); - } - - /** - * Use {@link OpenAiService#createCompletion(CompletionRequest)} and {@link CompletionRequest#model}instead - */ - @Deprecated - public CompletionResult createCompletion(String engineId, CompletionRequest request) { - return api.createCompletion(engineId, request).blockingGet(); - } - - public EditResult createEdit(EditRequest request) { - return api.createEdit(request).blockingGet(); - } - - /** - * Use {@link OpenAiService#createEdit(EditRequest)} and {@link EditRequest#model}instead - */ - @Deprecated - public EditResult createEdit(String engineId, EditRequest request) { - return api.createEdit(engineId, request).blockingGet(); - } - - public EmbeddingResult createEmbeddings(EmbeddingRequest request) { - return api.createEmbeddings(request).blockingGet(); - } - - /** - * Use {@link OpenAiService#createEmbeddings(EmbeddingRequest)} and {@link EmbeddingRequest#model}instead - */ - @Deprecated - public EmbeddingResult createEmbeddings(String engineId, EmbeddingRequest request) { - return api.createEmbeddings(engineId, request).blockingGet(); - } - - public List listFiles() { - return api.listFiles().blockingGet().data; - } - - public File uploadFile(String purpose, String filepath) { - java.io.File file = new java.io.File(filepath); - RequestBody purposeBody = RequestBody.create(okhttp3.MultipartBody.FORM, purpose); - RequestBody fileBody = RequestBody.create(MediaType.parse("text"), file); - MultipartBody.Part body = MultipartBody.Part.createFormData("file", filepath, fileBody); - - return api.uploadFile(purposeBody, body).blockingGet(); - } - - public DeleteResult deleteFile(String fileId) { - return api.deleteFile(fileId).blockingGet(); - } - - public File retrieveFile(String fileId) { - return api.retrieveFile(fileId).blockingGet(); - } - - public FineTuneResult createFineTune(FineTuneRequest request) { - return api.createFineTune(request).blockingGet(); - } - - public CompletionResult createFineTuneCompletion(CompletionRequest request) { - return api.createFineTuneCompletion(request).blockingGet(); - } - - public List listFineTunes() { - return api.listFineTunes().blockingGet().data; - } - - public FineTuneResult retrieveFineTune(String fineTuneId) { - return api.retrieveFineTune(fineTuneId).blockingGet(); - } - - public FineTuneResult cancelFineTune(String fineTuneId) { - return api.cancelFineTune(fineTuneId).blockingGet(); - } - - public List listFineTuneEvents(String fineTuneId) { - return api.listFineTuneEvents(fineTuneId).blockingGet().data; - } - - public DeleteResult deleteFineTune(String fineTuneId) { - return api.deleteFineTune(fineTuneId).blockingGet(); - } - - public ImageResult createImage(CreateImageRequest request) { - return api.createImage(request).blockingGet(); - } - - public ImageResult createImageEdit(CreateImageEditRequest request, String imagePath, String maskPath) { - java.io.File image = new java.io.File(imagePath); - java.io.File mask = null; - if (maskPath != null) { - mask = new java.io.File(maskPath); - } - return createImageEdit(request, image, mask); - } - - public ImageResult createImageEdit(CreateImageEditRequest request, java.io.File image, java.io.File mask) { - RequestBody imageBody = RequestBody.create(MediaType.parse("image"), image); - - MultipartBody.Builder builder = new MultipartBody.Builder() - .setType(MediaType.get("multipart/form-data")) - .addFormDataPart("prompt", request.getPrompt()) - .addFormDataPart("size", request.getSize()) - .addFormDataPart("response_format", request.getResponseFormat()) - .addFormDataPart("image", "image", imageBody); - - if (request.getN() != null) { - builder.addFormDataPart("n", request.getN().toString()); - } - - if (mask != null) { - RequestBody maskBody = RequestBody.create(MediaType.parse("image"), mask); - builder.addFormDataPart("mask", "mask", maskBody); - } - - return api.createImageEdit(builder.build()).blockingGet(); - } - - public ImageResult createImageVariation(CreateImageVariationRequest request, String imagePath) { - java.io.File image = new java.io.File(imagePath); - return createImageVariation(request, image); - } - - public ImageResult createImageVariation(CreateImageVariationRequest request, java.io.File image) { - RequestBody imageBody = RequestBody.create(MediaType.parse("image"), image); - - MultipartBody.Builder builder = new MultipartBody.Builder() - .setType(MediaType.get("multipart/form-data")) - .addFormDataPart("size", request.getSize()) - .addFormDataPart("response_format", request.getResponseFormat()) - .addFormDataPart("image", "image", imageBody); - - if (request.getN() != null) { - builder.addFormDataPart("n", request.getN().toString()); - } - - return api.createImageVariation(builder.build()).blockingGet(); - } - - public ModerationResult createModeration(ModerationRequest request) { - return api.createModeration(request).blockingGet(); - } - - @Deprecated - public List getEngines() { - return api.getEngines().blockingGet().data; - } - - @Deprecated - public Engine getEngine(String engineId) { - return api.getEngine(engineId).blockingGet(); - } -} diff --git a/client/src/test/java/com/theokanning/openai/CompletionTest.java b/client/src/test/java/com/theokanning/openai/CompletionTest.java deleted file mode 100644 index 96883ca..0000000 --- a/client/src/test/java/com/theokanning/openai/CompletionTest.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.theokanning.openai; - -import com.theokanning.openai.completion.CompletionChoice; -import com.theokanning.openai.completion.CompletionRequest; -import org.junit.jupiter.api.Test; - -import java.util.HashMap; -import java.util.List; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; - - -public class CompletionTest { - - String token = System.getenv("OPENAI_TOKEN"); - OpenAiService service = new OpenAiService(token); - - @Test - void createCompletion() { - CompletionRequest completionRequest = CompletionRequest.builder() - .model("ada") - .prompt("Somebody once told me the world is gonna roll me") - .echo(true) - .n(5) - .maxTokens(50) - .user("testing") - .logitBias(new HashMap<>()) - .build(); - - List choices = service.createCompletion(completionRequest).getChoices(); - assertEquals(5, choices.size()); - } - - @Test - void createCompletionDeprecated() { - CompletionRequest completionRequest = CompletionRequest.builder() - .prompt("Somebody once told me the world is gonna roll me") - .echo(true) - .user("testing") - .build(); - - List choices = service.createCompletion("ada", completionRequest).getChoices(); - assertFalse(choices.isEmpty()); - } -} diff --git a/client/src/test/java/com/theokanning/openai/EditTest.java b/client/src/test/java/com/theokanning/openai/EditTest.java deleted file mode 100644 index 61be016..0000000 --- a/client/src/test/java/com/theokanning/openai/EditTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.theokanning.openai; - -import com.theokanning.openai.edit.EditRequest; -import com.theokanning.openai.edit.EditResult; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertNotNull; - -public class EditTest { - - String token = System.getenv("OPENAI_TOKEN"); - OpenAiService service = new OpenAiService(token); - - @Test - void edit() { - EditRequest request = EditRequest.builder() - .model("text-davinci-edit-001") - .input("What day of the wek is it?") - .instruction("Fix the spelling mistakes") - .build(); - - EditResult result = service.createEdit( request); - - assertNotNull(result.getChoices().get(0).getText()); - } - - @Test - void editDeprecated() { - EditRequest request = EditRequest.builder() - .input("What day of the wek is it?") - .instruction("Fix the spelling mistakes") - .build(); - - EditResult result = service.createEdit("text-davinci-edit-001", request); - - assertNotNull(result.getChoices().get(0).getText()); - } -} diff --git a/client/src/test/java/com/theokanning/openai/EmbeddingTest.java b/client/src/test/java/com/theokanning/openai/EmbeddingTest.java deleted file mode 100644 index 16628e0..0000000 --- a/client/src/test/java/com/theokanning/openai/EmbeddingTest.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.theokanning.openai; - -import com.theokanning.openai.embedding.Embedding; -import com.theokanning.openai.embedding.EmbeddingRequest; -import org.junit.jupiter.api.Test; - -import java.util.Collections; -import java.util.List; - -import static org.junit.jupiter.api.Assertions.assertFalse; - - -public class EmbeddingTest { - - String token = System.getenv("OPENAI_TOKEN"); - OpenAiService service = new OpenAiService(token); - - @Test - void createEmbeddings() { - EmbeddingRequest embeddingRequest = EmbeddingRequest.builder() - .model("text-similarity-babbage-001") - .input(Collections.singletonList("The food was delicious and the waiter...")) - .build(); - - List embeddings = service.createEmbeddings(embeddingRequest).getData(); - - assertFalse(embeddings.isEmpty()); - assertFalse(embeddings.get(0).getEmbedding().isEmpty()); - } - - @Test - void createEmbeddingsDeprecated() { - EmbeddingRequest embeddingRequest = EmbeddingRequest.builder() - .input(Collections.singletonList("The food was delicious and the waiter...")) - .build(); - - List embeddings = service.createEmbeddings("text-similarity-babbage-001", embeddingRequest).getData(); - - assertFalse(embeddings.isEmpty()); - assertFalse(embeddings.get(0).getEmbedding().isEmpty()); - } -} diff --git a/client/src/test/java/com/theokanning/openai/EngineTest.java b/client/src/test/java/com/theokanning/openai/EngineTest.java deleted file mode 100644 index 5e52273..0000000 --- a/client/src/test/java/com/theokanning/openai/EngineTest.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.theokanning.openai; - -import com.theokanning.openai.engine.Engine; -import org.junit.jupiter.api.Test; - -import java.util.List; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; - - -public class EngineTest { - - String token = System.getenv("OPENAI_TOKEN"); - OpenAiService service = new OpenAiService(token); - - @Test - void getEngines() { - List engines = service.getEngines(); - - assertFalse(engines.isEmpty()); - } - - @Test - void getEngine() { - Engine ada = service.getEngine("ada"); - - assertEquals("ada", ada.id); - } -} diff --git a/client/src/test/java/com/theokanning/openai/FileTest.java b/client/src/test/java/com/theokanning/openai/FileTest.java deleted file mode 100644 index 9bfe5ae..0000000 --- a/client/src/test/java/com/theokanning/openai/FileTest.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.theokanning.openai; - -import com.theokanning.openai.file.File; -import org.junit.jupiter.api.*; - -import java.util.List; -import java.util.concurrent.TimeUnit; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -@TestMethodOrder(MethodOrderer.OrderAnnotation.class) -public class FileTest { - static String filePath = "src/test/resources/fine-tuning-data.jsonl"; - - String token = System.getenv("OPENAI_TOKEN"); - OpenAiService service = new OpenAiService(token); - static String fileId; - - @Test - @Order(1) - void uploadFile() throws Exception { - File file = service.uploadFile("fine-tune", filePath); - fileId = file.getId(); - - assertEquals("fine-tune", file.getPurpose()); - assertEquals(filePath, file.getFilename()); - - // wait for file to be processed - TimeUnit.SECONDS.sleep(10); - } - - @Test - @Order(2) - void listFiles() { - List files = service.listFiles(); - - assertTrue(files.stream().anyMatch(file -> file.getId().equals(fileId))); - } - - @Test - @Order(3) - void retrieveFile() { - File file = service.retrieveFile(fileId); - - assertEquals(filePath, file.getFilename()); - } - - @Test - @Order(4) - void deleteFile() { - DeleteResult result = service.deleteFile(fileId); - assertTrue(result.isDeleted()); - } -} diff --git a/client/src/test/java/com/theokanning/openai/FineTuneTest.java b/client/src/test/java/com/theokanning/openai/FineTuneTest.java deleted file mode 100644 index 245da09..0000000 --- a/client/src/test/java/com/theokanning/openai/FineTuneTest.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.theokanning.openai; - -import com.theokanning.openai.finetune.FineTuneRequest; -import com.theokanning.openai.finetune.FineTuneEvent; -import com.theokanning.openai.finetune.FineTuneResult; -import org.junit.jupiter.api.*; - -import java.util.List; -import java.util.concurrent.TimeUnit; - -import static org.junit.jupiter.api.Assertions.*; - -@TestMethodOrder(MethodOrderer.OrderAnnotation.class) -public class FineTuneTest { - static OpenAiService service; - static String fileId; - static String fineTuneId; - - - @BeforeAll - static void setup() throws Exception { - String token = System.getenv("OPENAI_TOKEN"); - service = new OpenAiService(token); - fileId = service.uploadFile("fine-tune", "src/test/resources/fine-tuning-data.jsonl").getId(); - - // wait for file to be processed - TimeUnit.SECONDS.sleep(10); - } - - @AfterAll - static void teardown() { - service.deleteFile(fileId); - } - - @Test - @Order(1) - void createFineTune() { - FineTuneRequest request = FineTuneRequest.builder() - .trainingFile(fileId) - .model("ada") - .build(); - - FineTuneResult fineTune = service.createFineTune(request); - fineTuneId = fineTune.getId(); - - assertEquals("pending", fineTune.getStatus()); - } - - @Test - @Order(2) - void listFineTunes() { - List fineTunes = service.listFineTunes(); - - assertTrue(fineTunes.stream().anyMatch(fineTune -> fineTune.getId().equals(fineTuneId))); - } - - @Test - @Order(3) - void listFineTuneEvents() { - List events = service.listFineTuneEvents(fineTuneId); - - assertFalse(events.isEmpty()); - } - - @Test - @Order(3) - void retrieveFineTune() { - FineTuneResult fineTune = service.retrieveFineTune(fineTuneId); - - assertEquals("ada", fineTune.getModel()); - } - - @Test - @Order(4) - void cancelFineTune() { - FineTuneResult fineTune = service.cancelFineTune(fineTuneId); - - assertEquals("cancelled", fineTune.getStatus()); - } -} diff --git a/client/src/test/java/com/theokanning/openai/ImageTest.java b/client/src/test/java/com/theokanning/openai/ImageTest.java deleted file mode 100644 index be29073..0000000 --- a/client/src/test/java/com/theokanning/openai/ImageTest.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.theokanning.openai; - -import com.theokanning.openai.image.CreateImageEditRequest; -import com.theokanning.openai.image.CreateImageRequest; -import com.theokanning.openai.image.CreateImageVariationRequest; -import com.theokanning.openai.image.Image; -import org.junit.jupiter.api.Test; - -import java.util.List; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; - - -public class ImageTest { - - static String filePath = "src/test/resources/penguin.png"; - static String fileWithAlphaPath = "src/test/resources/penguin_with_alpha.png"; - static String maskPath = "src/test/resources/mask.png"; - - String token = System.getenv("OPENAI_TOKEN"); - OpenAiService service = new OpenAiService(token, 30); - - - @Test - void createImageUrl() { - CreateImageRequest createImageRequest = CreateImageRequest.builder() - .prompt("penguin") - .n(3) - .size("256x256") - .user("testing") - .build(); - - List images = service.createImage(createImageRequest).getData(); - assertEquals(3, images.size()); - assertNotNull(images.get(0).getUrl()); - } - - @Test - void createImageBase64() { - CreateImageRequest createImageRequest = CreateImageRequest.builder() - .prompt("penguin") - .responseFormat("b64_json") - .user("testing") - .build(); - - List images = service.createImage(createImageRequest).getData(); - assertEquals(1, images.size()); - assertNotNull(images.get(0).getB64Json()); - } - - @Test - void createImageEdit() { - CreateImageEditRequest createImageRequest = CreateImageEditRequest.builder() - .prompt("a penguin with a red background") - .responseFormat("url") - .size("256x256") - .user("testing") - .n(2) - .build(); - - List images = service.createImageEdit(createImageRequest, fileWithAlphaPath, null).getData(); - assertEquals(2, images.size()); - assertNotNull(images.get(0).getUrl()); - } - - @Test - void createImageEditWithMask() { - CreateImageEditRequest createImageRequest = CreateImageEditRequest.builder() - .prompt("a penguin with a red hat") - .responseFormat("url") - .size("256x256") - .user("testing") - .n(2) - .build(); - - List images = service.createImageEdit(createImageRequest, filePath, maskPath).getData(); - assertEquals(2, images.size()); - assertNotNull(images.get(0).getUrl()); - } - - @Test - void createImageVariation() { - CreateImageVariationRequest createImageVariationRequest = CreateImageVariationRequest.builder() - .responseFormat("url") - .size("256x256") - .user("testing") - .n(2) - .build(); - - List images = service.createImageVariation(createImageVariationRequest, filePath).getData(); - assertEquals(2, images.size()); - assertNotNull(images.get(0).getUrl()); - } -} diff --git a/client/src/test/java/com/theokanning/openai/ModelTest.java b/client/src/test/java/com/theokanning/openai/ModelTest.java deleted file mode 100644 index be7f573..0000000 --- a/client/src/test/java/com/theokanning/openai/ModelTest.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.theokanning.openai; - -import com.theokanning.openai.model.Model; -import org.junit.jupiter.api.Test; - -import java.util.List; - -import static org.junit.jupiter.api.Assertions.*; - - -public class ModelTest { - - String token = System.getenv("OPENAI_TOKEN"); - OpenAiService service = new OpenAiService(token); - - @Test - void listModels() { - List models = service.listModels(); - - assertFalse(models.isEmpty()); - } - - @Test - void getModel() { - Model ada = service.getModel("ada"); - - assertEquals("ada", ada.id); - assertEquals("openai", ada.ownedBy); - assertFalse(ada.permission.isEmpty()); - } -} diff --git a/client/src/test/java/com/theokanning/openai/ModerationTest.java b/client/src/test/java/com/theokanning/openai/ModerationTest.java deleted file mode 100644 index c6024c0..0000000 --- a/client/src/test/java/com/theokanning/openai/ModerationTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.theokanning.openai; - -import com.theokanning.openai.moderation.ModerationRequest; -import com.theokanning.openai.moderation.Moderation; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertTrue; - - -public class ModerationTest { - - String token = System.getenv("OPENAI_TOKEN"); - OpenAiService service = new OpenAiService(token); - - @Test - void createModeration() { - ModerationRequest moderationRequest = ModerationRequest.builder() - .input("I want to kill them") - .model("text-moderation-latest") - .build(); - - Moderation moderationScore = service.createModeration(moderationRequest).getResults().get(0); - - assertTrue(moderationScore.isFlagged()); - } -} diff --git a/client/src/test/resources/fine-tuning-data.jsonl b/client/src/test/resources/fine-tuning-data.jsonl deleted file mode 100644 index 2f0e4c7..0000000 --- a/client/src/test/resources/fine-tuning-data.jsonl +++ /dev/null @@ -1,2 +0,0 @@ -{"prompt": "prompt", "completion": "text"} -{"prompt": "prompt", "completion": "text"} \ No newline at end of file diff --git a/client/src/test/resources/mask.png b/client/src/test/resources/mask.png deleted file mode 100644 index 84fcfb3..0000000 Binary files a/client/src/test/resources/mask.png and /dev/null differ diff --git a/client/src/test/resources/penguin.png b/client/src/test/resources/penguin.png deleted file mode 100644 index 91b023c..0000000 Binary files a/client/src/test/resources/penguin.png and /dev/null differ diff --git a/client/src/test/resources/penguin_with_alpha.png b/client/src/test/resources/penguin_with_alpha.png deleted file mode 100644 index 4636c4f..0000000 Binary files a/client/src/test/resources/penguin_with_alpha.png and /dev/null differ diff --git a/example/build.gradle b/example/build.gradle deleted file mode 100644 index 0719011..0000000 --- a/example/build.gradle +++ /dev/null @@ -1,10 +0,0 @@ -apply plugin: 'java' -apply plugin: 'application' - -application { - mainClass.set('example.OpenAiApiExample') -} - -dependencies { - implementation project(":client") -} \ No newline at end of file diff --git a/example/src/main/java/example/OpenAiApiExample.java b/example/src/main/java/example/OpenAiApiExample.java deleted file mode 100644 index 27b6671..0000000 --- a/example/src/main/java/example/OpenAiApiExample.java +++ /dev/null @@ -1,20 +0,0 @@ -package example; - -import com.theokanning.openai.OpenAiService; -import com.theokanning.openai.completion.CompletionRequest; - -class OpenAiApiExample { - public static void main(String... args) { - String token = System.getenv("OPENAI_TOKEN"); - OpenAiService service = new OpenAiService(token); - - System.out.println("\nCreating completion..."); - CompletionRequest completionRequest = CompletionRequest.builder() - .model("ada") - .prompt("Somebody once told me the world is gonna roll me") - .echo(true) - .user("testing") - .build(); - service.createCompletion(completionRequest).getChoices().forEach(System.out::println); - } -} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 62d4c05..0000000 Binary files a/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index aa991fc..0000000 --- a/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/openai-j-client/pom.xml b/openai-j-client/pom.xml new file mode 100644 index 0000000..94ddccf --- /dev/null +++ b/openai-j-client/pom.xml @@ -0,0 +1,497 @@ + + + 4.0.0 + + + com.ossez + openai-j + 0.0.1-SNAPSHOT + + + openai-j-client + jar + + + OpenAI Java Client + The module that constitutes the main USRealEstate data process system + + + + The MIT license + https://opensource.org/licenses/mit-license.php + repo + + + + + + YuCheng Hu + honeymoose + huyuchengus@gmail.com + -5 + Open Source + + Sr. Java Developer + + + + + + scm:git:git://github.com/USRealEstate/Usreio-Parent.git + scm:git:ssh://git@github.com/USRealEstate/Usreio-Parent.git + https://github.com/USRealEstate + HEAD + + + + JIRA + http://bug.ossez.com/projects/USVisaTrack + + + + openai-j-api + openai-j-client + + + + + UTF-8 + private + + + github + jenkinsci + jenkins + https://api.github.com + jenkins-jira + + 1.7.25 + 2.8.2 + 2.14 + 1.4.1 + 0.11 + 3.0.4 + true + 1.2 + 1.11 + ${access-modifier.version} + + ${access-modifier.version} + 5.9.0 + + 11 + + https://upcex.com/changelog + + + + + + ossez-repo + Ossez-Repo-Snapshot + https://repo.ossez.com/repository/maven-snapshots/ + + true + + + false + + + + + + + + + + + + org.samba.jcifs + jcifs + 1.3.17-kohsuke-1 + + + org.kohsuke + access-modifier-annotation + ${access-modifier-annotation.version} + + + + + + + github-pages + gitsite:git@github.com/USRealEstate/Usreio-Docs.git:core + + + + ossez-repo + https://repo.ossez.com/repository/maven-releases/ + + + + ossez-repo + https://repo.ossez.com/repository/maven-snapshots/ + + + + + + + + + + org.slf4j + slf4j-api + ${slf4j.version} + + + + + commons-io + commons-io + 2.11.0 + + + org.apache.commons + commons-lang3 + 3.12.0 + + + org.apache.commons + commons-math3 + 3.6.1 + + + commons-net + commons-net + 3.6 + + + org.apache.commons + commons-csv + 1.5 + + + commons-validator + commons-validator + 1.6 + + + org.apache.httpcomponents + httpclient + 4.5.3 + + + org.apache.commons + commons-text + 1.9 + + + + + org.mockito + mockito-core + 1.10.19 + + + + org.powermock + powermock-module-junit4 + 1.6.2 + + + org.powermock + powermock-api-mockito + 1.6.2 + + + + + com.google.guava + guava + 31.1-jre + + + com.configcat + configcat-java-client + 7.2.0 + + + + + + + + joda-time + joda-time + 2.9.9 + + + + + org.junit.jupiter + junit-jupiter + 5.9.0 + test + + + org.assertj + assertj-core + 3.23.1 + test + + + + + + org.codehaus.mojo + animal-sniffer-annotations + 1.9 + provided + true + + + + + install + + + ${basedir}/src/main/resources + false + + + ${basedir}/src/filter/resources + true + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-deploy-plugin + 3.0.0 + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.8 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.5.1 + + true + alwaysNew + ${java.version} + ${java.version} + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.4 + + + org.apache.maven.plugins + maven-install-plugin + 2.3.1 + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.3 + + true + + + + org.apache.maven.plugins + maven-jar-plugin + 2.6 + + + org.apache.maven.plugins + maven-war-plugin + 2.6 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.20 + + -noverify + + + ${project.build.directory} + 3600 + true + + false + true + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.5.5 + + + + org.apache.maven.plugins + maven-resources-plugin + 2.6 + + + + org.kohsuke + access-modifier-checker + ${access-modifier-checker.version} + + + com.cloudbees + maven-license-plugin + 1.7 + + + + process + + compile + + true + + + + + + + org.jvnet.localizer + maven-localizer-plugin + 1.24 + + UTF-8 + + + + org.jvnet.hudson.tools + maven-encoding-plugin + 1.1 + + + com.infradna.tool + bridge-method-injector + 1.17 + + + org.codehaus.mojo + antlr-maven-plugin + 2.1 + + + org.codehaus.mojo + cobertura-maven-plugin + 2.5.2 + + + org.codehaus.mojo + findbugs-maven-plugin + ${findbugs-maven-plugin.version} + + Max + High + + ../src/findbugs/findbugs-excludes.xml + true + false + + + + findbugs + + check + + verify + + + + + org.apache.maven.plugins + maven-pmd-plugin + 3.19.0 + + + + org.jvnet.updatecenter2 + maven-makepkgs-plugin + 0.6.2 + + + + org.apache.maven.plugins + maven-site-plugin + 3.3 + + + org.kohsuke + doxia-module-markdown + 1.0 + + + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + + 11 + + + + org.apache.maven.plugins + maven-deploy-plugin + + + default-deploy + deploy + + deploy + + + + + + + + + org.kohsuke + wagon-gitsite + 0.3.5 + + + + + + +