Serialized Form

  • Package xyz.felh.openai

  • Package xyz.felh.openai.audio

    • Class xyz.felh.openai.audio.AudioResponse

      class AudioResponse extends Object implements Serializable
      • Serialized Fields

    • Class xyz.felh.openai.audio.CreateAudioTranscriptionRequest

      class CreateAudioTranscriptionRequest extends CreateAudioTranslationRequest implements Serializable
      • Serialized Fields

        • language
          String language
          Optional The language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency.
    • Class xyz.felh.openai.audio.CreateAudioTranslationRequest

      class CreateAudioTranslationRequest extends Object implements Serializable
      • Serialized Fields

        • file
          byte[] file
        • filePath
          String filePath
          Required must set filePath or file The audio file to transcribe, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
        • model
          @NonNull String model
          Required ID of the model to use. Only whisper-1 is currently available.
        • prompt
          String prompt
          Optional An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.
        • responseFormat
          String responseFormat
          Optional Defaults to json The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
        • temperature
          Double temperature
          Optional Defaults to 0 The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.
  • Package xyz.felh.openai.completion

    • Class xyz.felh.openai.completion.BaseCreateCompletionRequest

      class BaseCreateCompletionRequest extends Object implements Serializable
      • Serialized Fields

        • frequencyPenalty
          Double frequencyPenalty
          Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. See more information about frequency and presence penalties. Optional Defaults to 0
        • logitBias
          Map<String,Integer> logitBias
          Modify the likelihood of specified tokens appearing in the completion. Accepts a json object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this tokenizer tool (which works for both GPT-2 and GPT-3) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. As an example, you can pass {"50256": -100} to prevent the <|endoftext|> token from being generated.

          Optional Defaults to null

        • maxTokens
          Integer maxTokens
          The maximum number of tokens to generate in the completion. The token count of your prompt plus max_tokens cannot exceed the model's context length. Most models have a context length of 2048 tokens (except for the newest models, which support 4096). Optional Defaults to 16
        • model
          @NonNull String model
          ID of the model to use. Currently, only gpt-3.5-turbo and gpt-3.5-turbo-0301 are supported.
        • n
          Integer n
          How many completions to generate for each prompt. Note: Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for max_tokens and stop. Optional Defaults to 1
        • presencePenalty
          Double presencePenalty
          Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. See more information about frequency and presence penalties. Optional Defaults to 0
        • stop
          String stop
          Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. string or array Optional Defaults to null
        • stream
          Boolean stream
          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. Optional Defaults to false
        • temperature
          Double temperature
          What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both. Optional Defaults to 1
        • topP
          Double topP
          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 temperature but not both. Optional Defaults to 1
        • user
          String user
          A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more. Optional
    • Class xyz.felh.openai.completion.Completion

      class Completion extends OpenAiApiObjectWithId implements Serializable
    • Class xyz.felh.openai.completion.CompletionChoice

      class CompletionChoice extends Object implements Serializable
    • Class xyz.felh.openai.completion.CreateCompletionRequest

      class CreateCompletionRequest extends BaseCreateCompletionRequest implements Serializable
      • Serialized Fields

        • bestOf
          Integer bestOf
          Generates best_of completions server-side and returns the "best" (the one with the highest log probability per token). Results cannot be streamed. When used with n, best_of controls the number of candidate completions and n specifies how many to return – best_of must be greater than n. Note: Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for max_tokens and stop. Optional Defaults to 1
        • echo
          Boolean echo
          Echo back the prompt in addition to the completion Optional Defaults to false
        • logprobs
          Integer logprobs
          Include the log probabilities on the logprobs most likely tokens, as well the chosen tokens. For example, if logprobs is 5, the API will return a list of the 5 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. The maximum value for logprobs is 5. If you need more than this, please contact us through our Help center and describe your use case. Optional Defaults to null
        • prompt
          String prompt
          The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays. Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document. string or array Optional Defaults to <|endoftext|>
        • suffix
          String suffix
          The suffix that comes after a completion of inserted text. Optional Defaults to null
    • Class xyz.felh.openai.completion.Logprobs

      class Logprobs extends Object implements Serializable
  • Package xyz.felh.openai.completion.chat

  • Package xyz.felh.openai.edit

    • Class xyz.felh.openai.edit.CreateEditRequest

      class CreateEditRequest extends Object implements Serializable
      • Serialized Fields

        • input
          String input
          Optional Defaults to '' The input text to use as a starting point for the edit.
        • instruction
          @NonNull String instruction
          Required The instruction that tells the model how to edit the prompt.
        • model
          @NonNull String model
          string Required ID of the model to use. You can use the text-davinci-edit-001 or code-davinci-edit-001 model with this endpoint.
        • n
          Integer n
          Optional Defaults to 1 How many edits to generate for the input and instruction.
        • temperature
          Double temperature
          Optional Defaults to 1 What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

          We generally recommend altering this or top_p but not both.

        • topP
          Double topP
          Optional Defaults to 1 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 temperature but not both.
    • Class xyz.felh.openai.edit.Edit

      class Edit extends Object implements Serializable
      • Serialized Fields

        • choices
          List<EditChoice> choices
        • created
          Long created
          The creation time in epoch seconds.
        • object
          String object
          The type of object returned, always "edit"
        • usage
          Usage usage
    • Class xyz.felh.openai.edit.EditChoice

      class EditChoice extends Object implements Serializable
  • Package xyz.felh.openai.embedding

  • Package xyz.felh.openai.file

  • Package xyz.felh.openai.finetune

    • Class xyz.felh.openai.finetune.CreateFineTuneRequest

      class CreateFineTuneRequest extends Object implements Serializable
      • Serialized Fields

        • batchSize
          Integer batchSize
          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.

        • classificationBetas
          List<Double> classificationBetas
          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.

        • classificationNClasses
          Integer classificationNClasses
          The number of classes in a classification task.

          This parameter is required for multiclass classification.

        • classificationPositiveClass
          String classificationPositiveClass
          The positive class in binary classification.

          This parameter is needed to generate precision, recall, and F1 metrics when doing binary classification.

        • computeClassificationMetrics
          Boolean computeClassificationMetrics
          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 CreateFineTuneRequest.classificationNClasses for multiclass classification or CreateFineTuneRequest.classificationPositiveClass for binary classification.

        • learningRateMultiplier
          Double learningRateMultiplier
          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.

        • model
          String model
          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.
        • nEpochs
          Integer nEpochs
          The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
        • promptLossWeight
          Double promptLossWeight
          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.

        • suffix
          String suffix
          A string of up to 40 characters that will be added to your fine-tuned model name.
        • trainingFile
          @NonNull String trainingFile
          The ID of an uploaded file that contains training data.
        • validationFile
          String validationFile
          The ID of an uploaded file that contains validation data.
    • Class xyz.felh.openai.finetune.FineTune

      class FineTune extends OpenAiApiObjectWithId implements Serializable
      • Serialized Fields

        • createdAt
          Long createdAt
          The creation time in epoch seconds.
        • events
          List<FineTuneEvent> events
          List of events in this job's lifecycle. Null when getting a list of fine-tune jobs.
        • fineTunedModel
          String fineTunedModel
          The ID of the fine-tuned model, null if tuning job is not finished. This is the id used to call the model.
        • hyperparams
          HyperParameters hyperparams
          The specified hyper-parameters for the tuning job.
        • model
          String model
          The name of the base model.
        • organizationId
          String organizationId
          The ID of the organization this model belongs to.
        • resultFiles
          List<File> resultFiles
          Result files for this fine-tune job.
        • status
          String status
          The status os the fine-tune job. "pending", "succeeded", or "cancelled"
        • trainingFiles
          List<File> trainingFiles
          Training files for this fine-tune job.
        • updatedAt
          Long updatedAt
          The last update time in epoch seconds.
        • validationFiles
          List<File> validationFiles
    • Class xyz.felh.openai.finetune.FineTuneEvent

      class FineTuneEvent extends Object implements Serializable
      • Serialized Fields

        • createdAt
          Long createdAt
          The creation time in epoch seconds.
        • level
          String level
          The log level of this message.
        • message
          String message
          The event message.
        • object
          String object
          The type of object returned, should be "fine-tune-event".
    • Class xyz.felh.openai.finetune.HyperParameters

      class HyperParameters extends Object implements Serializable
      • Serialized Fields

        • batchSize
          String batchSize
          The batch size to use for training.
        • learningRateMultiplier
          Double learningRateMultiplier
          The learning rate multiplier to use for training.
        • nEpochs
          Integer nEpochs
          The number of epochs to train the model for.
        • promptLossWeight
          Double promptLossWeight
          The weight to use for loss on the prompt tokens.
  • Package xyz.felh.openai.image

  • Package xyz.felh.openai.image.edit

    • Class xyz.felh.openai.image.edit.CreateImageEditRequest

      class CreateImageEditRequest extends BaseCreateImageRequest implements Serializable
      • Serialized Fields

        • image
          byte[] image
        • imagePath
          String imagePath
          Required image or imagePath The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask.
        • mask
          byte[] mask
          Optional An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as image.
        • maskPath
          String maskPath
        • prompt
          @NonNull String prompt
          Required A text description of the desired image(s). The maximum length is 1000 characters.
  • Package xyz.felh.openai.image.variation

  • Package xyz.felh.openai.model

  • Package xyz.felh.openai.moderation

    • Class xyz.felh.openai.moderation.CreateModerationRequest

      class CreateModerationRequest extends Object implements Serializable
      • Serialized Fields

        • input
          @NonNull String input
          The input text to classify
        • model
          String model
          Optional Defaults to text-moderation-latest Two content moderations models are available: text-moderation-stable and text-moderation-latest.

          The default is text-moderation-latest which will be automatically upgraded over time. This ensures you are always using our most accurate model. If you use text-moderation-stable, we will provide advanced notice before updating the model. Accuracy of text-moderation-stable may be slightly lower than for text-moderation-latest.

    • Class xyz.felh.openai.moderation.CreateModerationResponse

      class CreateModerationResponse extends Object implements Serializable
    • Class xyz.felh.openai.moderation.Moderation

      class Moderation extends Object implements Serializable
      • Serialized Fields

        • categories
          ModerationCategories categories
          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.
        • categoryScores
          ModerationCategoryScores categoryScores
          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.
        • flagged
          Boolean flagged
          Set to true if the model classifies the content as violating OpenAI's content policy, false otherwise
    • Class xyz.felh.openai.moderation.ModerationCategories

      class ModerationCategories extends Object implements Serializable
      • Serialized Fields

        • hate
          boolean hate
        • hateThreatening
          boolean hateThreatening
        • selfHarm
          boolean selfHarm
        • sexual
          boolean sexual
        • sexualMinors
          boolean sexualMinors
        • violence
          boolean violence
        • violenceGraphic
          boolean violenceGraphic
    • Class xyz.felh.openai.moderation.ModerationCategoryScores

      class ModerationCategoryScores extends Object implements Serializable
      • Serialized Fields

        • hate
          double hate
        • hateThreatening
          double hateThreatening
        • selfHarm
          double selfHarm
        • sexual
          double sexual
        • sexualMinors
          double sexualMinors
        • violence
          double violence
        • violenceGraphic
          double violenceGraphic