Serialized Form
-
Package xyz.felh.openai
-
Class xyz.felh.openai.DeleteResponse
class DeleteResponse extends Object implements Serializable -
Class xyz.felh.openai.OpenAiApiListResponse
class OpenAiApiListResponse extends Object implements Serializable-
Serialized Fields
-
data
List<T extends IOpenAiApiObject> data
A list containing the actual results -
hasMore
Boolean hasMore
是否有更多 -
object
String object
always "list"
-
-
-
Class xyz.felh.openai.OpenAiApiObjectWithId
class OpenAiApiObjectWithId extends Object implements Serializable -
Class xyz.felh.openai.OpenAiError
class OpenAiError extends Object implements Serializable-
Serialized Fields
-
error
OpenAiError.ErrorDetail error
-
-
-
Class xyz.felh.openai.OpenAiError.ErrorDetail
class ErrorDetail extends Object implements Serializable-
Serialized Fields
-
-
Exception xyz.felh.openai.OpenAiHttpException
class OpenAiHttpException extends RuntimeException implements Serializable -
Class xyz.felh.openai.Usage
class Usage extends Object implements Serializable
-
-
Package xyz.felh.openai.audio
-
Class xyz.felh.openai.audio.AudioResponse
class AudioResponse extends Object implements Serializable-
Serialized Fields
-
text
String text
-
-
-
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-
Serialized Fields
-
choices
List<CompletionChoice> choices
-
created
Long created
-
model
String model
-
usage
Usage usage
-
-
-
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
-
Class xyz.felh.openai.completion.chat.ChatCompletion
class ChatCompletion extends OpenAiApiObjectWithId implements Serializable-
Serialized Fields
-
choices
List<ChatCompletionChoice> choices
-
created
Long created
-
model
String model
-
usage
Usage usage
-
-
-
Class xyz.felh.openai.completion.chat.ChatCompletionChoice
class ChatCompletionChoice extends Object implements Serializable-
Serialized Fields
-
delta
ChatMessage delta
-
finishReason
String finishReason
-
index
Integer index
-
message
ChatMessage message
-
-
-
Class xyz.felh.openai.completion.chat.CreateChatCompletionRequest
class CreateChatCompletionRequest extends BaseCreateCompletionRequest implements Serializable-
Serialized Fields
-
functionCall
Object functionCall
Controls how the model responds to function calls. "none" means the model does not call a function, and responds to the end-user. "auto" means the model can pick between an end-user or calling a function. Specifying a particular function via {"name":\ "my_function"} forces the model to call that function. "none" is the default when no functions are present. "auto" is the default if functions are present. -
functions
List<Function> functions
A list of functions the model may generate JSON inputs for. -
messages
@NonNull List<ChatMessage> messages
-
-
-
-
Package xyz.felh.openai.embedding
-
Class xyz.felh.openai.embedding.CreateEmbeddingRequest
class CreateEmbeddingRequest extends Object implements Serializable-
Serialized Fields
-
input
@NonNull String input
string or array Required 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 8192 tokens in length. -
model
@NonNull String model
Required ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them. -
user
String user
Optional A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
-
-
-
Class xyz.felh.openai.embedding.CreateEmbeddingResponse
class CreateEmbeddingResponse extends Object implements Serializable -
Class xyz.felh.openai.embedding.Embedding
class Embedding extends Object implements Serializable
-
-
Package xyz.felh.openai.file
-
Class xyz.felh.openai.file.File
class File extends OpenAiApiObjectWithId implements Serializable-
Serialized Fields
-
bytes
Long bytes
File size in bytes. -
createdAt
Long createdAt
The creation time in epoch seconds. -
filename
String filename
The name of the file. -
purpose
String purpose
Description of the file's purpose. -
status
String status
The current status of the file, which can be either uploaded, processed, pending, error, deleting or deleted. -
statusDetails
String statusDetails
Additional details about the status of the file. If the file is in the error state, this will include a message describing the error.
-
-
-
Class xyz.felh.openai.file.RetrieveFileContentResponse
class RetrieveFileContentResponse extends Object implements Serializable
-
-
Package xyz.felh.openai.fineTuning
-
Class xyz.felh.openai.fineTuning.CreateFineTuningJobRequest
class CreateFineTuningJobRequest extends Object implements Serializable-
Serialized Fields
-
hyperparameters
Hyperparameters hyperparameters
Optional The hyperparameters used for the fine-tuning job. -
model
@NonNull String model
The name of the model to fine-tune. You can select one of the supported models. -
suffix
String suffix
Optional Defaults to nullA string of up to 40 characters that will be added to your fine-tuned model name.
For example, a suffix of "custom-model-name" would produce a model name like ft:gpt-3.5-turbo:openai:custom-model-name:7p4lURel.
-
trainingFile
@NonNull String trainingFile
The ID of an uploaded file that contains training data. Your dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose fine-tune. -
validationFile
String validationFile
OptionalThe ID of an uploaded file that contains validation data.
If you provide this file, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in the fine-tuning results file. The same data should not be present in both train and validation files.
Your dataset must be formatted as a JSONL file. You must upload your file with the purpose fine-tune.
-
-
-
Class xyz.felh.openai.fineTuning.FineTuningJob
class FineTuningJob extends OpenAiApiObjectWithId implements Serializable-
Serialized Fields
-
createdAt
Long createdAt
The unix timestamp for when the fine-tuning job was created. -
fineTunedModel
String fineTunedModel
The name of the fine-tuned model that is being created. -
finishedAt
Long finishedAt
The unix timestamp for when the fine-tuning job was finished. -
hyperparameters
Hyperparameters hyperparameters
The hyperparameters used for the fine-tuning job. -
model
String model
The base model that is being fine-tuned. -
organizationId
String organizationId
The organization that owns the fine-tuning job. -
resultFiles
List<String> resultFiles
The compiled results files for the fine-tuning job. -
status
String status
The current status of the fine-tuning job, which can be either created, pending, running, succeeded, failed, or cancelled. -
trainedTokens
Long trainedTokens
The total number of billable tokens processed by this fine tuning job. -
trainingFile
String trainingFile
The file ID used for training. -
validationFile
String validationFile
string or null The file ID used for validation.
-
-
-
Class xyz.felh.openai.fineTuning.FineTuningJobEvent
class FineTuningJobEvent extends OpenAiApiObjectWithId implements Serializable -
Class xyz.felh.openai.fineTuning.Hyperparameters
class Hyperparameters extends Object implements Serializable-
Serialized Fields
-
nEpochs
String nEpochs
The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. "Auto" decides the optimal number of epochs based on the size of the dataset. If setting the number manually, we support any number between 1 and 50 epochs.
-
-
-
-
Package xyz.felh.openai.image
-
Class xyz.felh.openai.image.BaseCreateImageRequest
class BaseCreateImageRequest extends Object implements Serializable-
Serialized Fields
-
n
Integer n
Optional Defaults to 1 The number of images to generate. Must be between 1 and 10. -
responseFormat
String responseFormat
Optional Defaults to url The format in which the generated images are returned. Must be one of url or b64_json. -
size
String size
Optional Defaults to 1024x1024 The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024. -
user
String user
Optional A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. learn more https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
-
-
-
Class xyz.felh.openai.image.CreateImageRequest
class CreateImageRequest extends BaseCreateImageRequest implements Serializable-
Serialized Fields
-
prompt
@NonNull String prompt
Required A text description of the desired image(s). The maximum length is 1000 characters.
-
-
-
Class xyz.felh.openai.image.Image
class Image extends Object implements Serializable -
Class xyz.felh.openai.image.ImageResponse
class ImageResponse extends Object implements Serializable
-
-
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
-
Class xyz.felh.openai.image.variation.CreateImageVariationRequest
class CreateImageVariationRequest extends BaseCreateImageRequest implements Serializable-
Serialized Fields
-
image
byte[] image
-
imagePath
String imagePath
Required image or imagePath The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.
-
-
-
-
Package xyz.felh.openai.model
-
Class xyz.felh.openai.model.Model
class Model extends OpenAiApiObjectWithId implements Serializable -
Class xyz.felh.openai.model.Permission
class Permission extends OpenAiApiObjectWithId implements Serializable-
Serialized Fields
-
allowCreateEngine
Boolean allowCreateEngine
-
allowFineTuning
Boolean allowFineTuning
-
allowLogprobs
Boolean allowLogprobs
-
allowSampling
Boolean allowSampling
-
allowSearchIndices
Boolean allowSearchIndices
-
allowView
Boolean allowView
-
group
String group
-
isBlocking
Boolean isBlocking
-
organization
String organization
-
-
-
-
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-
Serialized Fields
-
id
String id
-
model
String model
-
results
List<Moderation> results
-
-
-
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
-
-
-