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 -
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 -
Exception Class 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.assistant
-
Class xyz.felh.openai.assistant.Assistant
class Assistant extends OpenAiApiObjectWithId implements Serializable-
Serialized Fields
-
createdAt
Integer createdAt
The Unix timestamp (in seconds) for when the assistant was created. -
description
String description
The description of the assistant. The maximum length is 512 characters. -
fileIds
List<String> fileIds
A list of file IDs attached to this assistant. There can be a maximum of 20 files attached to the assistant. Files are ordered by their creation date in ascending order. -
instructions
String instructions
The system instructions that the assistant uses. The maximum length is 32768 characters. -
metadata
Map<String,
String> metadata Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. -
model
String model
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. -
name
String name
The name of the assistant. The maximum length is 256 characters. -
tools
List<AssistantTool> tools
A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types code_interpreter, retrieval, or function. SeeAssistantTool
-
-
-
Class xyz.felh.openai.assistant.AssistantTool
class AssistantTool extends Object implements Serializable-
Serialized Fields
-
function
Function function
When type is functionSee
Function -
type
AssistantTool.Type type
The type of tool being defined: code_interpreter, retrieval, function
-
-
-
Class xyz.felh.openai.assistant.CreateAssistantRequest
class CreateAssistantRequest extends Object implements Serializable-
Serialized Fields
-
description
String description
The description of the assistant. The maximum length is 512 characters. -
fileIds
List<String> fileIds
A list of file IDs attached to this assistant. There can be a maximum of 20 files attached to the assistant. Files are ordered by their creation date in ascending order. -
instructions
String instructions
The system instructions that the assistant uses. The maximum length is 32768 characters. -
metadata
Map<String,
String> metadata Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. -
model
@NonNull String model
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. -
name
String name
The name of the assistant. The maximum length is 256 characters. -
tools
List<AssistantTool> tools
A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types code_interpreter, retrieval, or function.Defaults to []
See
AssistantTool
-
-
-
Class xyz.felh.openai.assistant.ModifyAssistantRequest
class ModifyAssistantRequest extends Object implements Serializable-
Serialized Fields
-
description
String description
The description of the assistant. The maximum length is 512 characters. -
fileIds
List<String> fileIds
A list of file IDs attached to this assistant. There can be a maximum of 20 files attached to the assistant. Files are ordered by their creation date in ascending order. -
instructions
String instructions
The system instructions that the assistant uses. The maximum length is 32768 characters. -
metadata
Map<String,
String> metadata Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. -
model
String model
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. -
name
String name
The name of the assistant. The maximum length is 256 characters. -
tools
List<AssistantTool> tools
A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types code_interpreter, retrieval, or function.Defaults to []
See
AssistantTool
-
-
-
-
Package xyz.felh.openai.assistant.file
-
Class xyz.felh.openai.assistant.file.AssistantFile
class AssistantFile extends OpenAiApiObjectWithId implements Serializable -
Class xyz.felh.openai.assistant.file.CreateAssistantFileRequest
class CreateAssistantFileRequest extends Object implements Serializable-
Serialized Fields
-
fileId
@NonNull String fileId
A File ID (with purpose="assistants") that the assistant should use. Useful for tools like retrieval and code_interpreter that can access files.
-
-
-
-
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 fileThe audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, 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
CreateAudioTranslationRequest.ResponseFormat responseFormat
Optional Defaults to jsonThe format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
-
temperature
Double temperature
Optional Defaults to 0The 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.
-
-
-
Class xyz.felh.openai.audio.CreateSpeechRequest
class CreateSpeechRequest extends Object implements Serializable-
Serialized Fields
-
input
@NonNull String input
The text to generate audio for. The maximum length is 4096 characters. -
model
@NonNull String model
One of the available TTS models: tts-1 or tts-1-hd -
responseFormat
CreateSpeechRequest.ResponseFormat responseFormat
string Optional Defaults to mp3The format to audio in. Supported formats are mp3, opus, aac, and flac.
-
speed
Double speed
number Optional Defaults to 1The speed of the generated audio. Select a value from 0.25 to 4.0. 1.0 is the default.
-
voice
@NonNull CreateSpeechRequest.Voice voice
The voice to use when generating the audio. Supported voices are alloy, echo, fable, onyx, nova, and shimmer. Previews of the voices are available in the Text to speech guide.
-
-
-
-
Package xyz.felh.openai.chat
-
Class xyz.felh.openai.chat.ChatCompletion
class ChatCompletion extends OpenAiApiObjectWithId implements Serializable-
Serialized Fields
-
choices
List<ChatCompletionChoice> choices
A list of chat completion choices. Can be more than one if n is greater than 1. -
created
Long created
The Unix timestamp (in seconds) of when the chat completion was created. -
model
String model
The model used for the chat completion. -
systemFingerprint
String systemFingerprint
This fingerprint represents the backend configuration that the model runs with.Can be used in conjunction with the
request parameter to understand when backend changes have been made that might impact determinism.invalid reference
CreateChatCompletionRequest#getSeed()
-
usage
Usage usage
Usage statistics for the completion request. SeeUsage
-
-
-
Class xyz.felh.openai.chat.ChatCompletionChoice
class ChatCompletionChoice extends Object implements Serializable-
Serialized Fields
-
delta
ChatMessage delta
A chat completion delta generated by streamed model responses.See
ChatMessage -
finishReason
String finishReason
The reason the model stopped generating tokens. This will be stop if the model hit a natural stop point or a provided stop sequence, length if the maximum number of tokens specified in the request was reached, content_filter if content was omitted due to a flag from our content filters, tool_calls if the model called a tool, or function_call (deprecated) if the model called a function. -
index
Integer index
The index of the choice in the list of choices. -
message
ChatMessage message
A chat completion message generated by the model.See
ChatMessage
-
-
-
Class xyz.felh.openai.chat.ChatMessage
class ChatMessage extends Object implements Serializable-
Serialized Fields
-
content
Object content
The contents of the message1. role=system, string or null, required
2. role=user, string or array, required
3. role=assistant, string or null, required
4. role=tool, string or null, required -
name
String name
An optional name for the participant. Provides the model information to differentiate between participants of the same role.Optional
Do not provide this field when role is tool.
-
role
@NonNull ChatMessageRole role
Must be either 'system', 'user', 'assistant', or 'tool'.
You may useChatMessageenum. -
toolCallId
String toolCallId
Tool call that this message is responding to.String, Required It is provided when role is
ChatMessageRole.TOOL -
toolCalls
List<ToolCall> toolCalls
The tool calls generated by the model, such as function calls.Array, Optional It is provided when role is assistant
See
ToolCall
-
-
-
Class xyz.felh.openai.chat.ChatMessage.ContentItem
class ContentItem extends Object implements Serializable-
Serialized Fields
-
imageUrl
ChatMessage.ImageUrl imageUrl
Image url -
text
String text
The text content. -
type
ChatMessage.ContentType type
The type of the content part.
-
-
-
Class xyz.felh.openai.chat.ChatMessage.ImageUrl
class ImageUrl extends Object implements Serializable-
Serialized Fields
-
detail
ChatMessage.ImageUrlDetail detail
Specifies the detail level of the image.Optional, Defaults to auto
-
url
@NonNull String url
Either a URL of the image or the base64 encoded image data.
-
-
-
Class xyz.felh.openai.chat.CreateChatCompletionRequest
class CreateChatCompletionRequest 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.Number or null, Optional, Defaults to 0
See more information about frequency and presence penalties.
-
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 tokenizer) to an associated bias value from -100 to 100. 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.
Map, Optional Defaults to null
-
maxTokens
Integer maxTokens
The maximum number of tokens to generate in the chat completion.The total length of input tokens and generated tokens is limited by the model's context length. Example Python code for counting tokens.
integer or null, Optional
Defaults to inf
-
messages
@NonNull List<ChatMessage> messages
A list of messages comprising the conversation so far. See api documentSee
ChatMessage -
model
@NonNull String model
ID of the model to use. See the model endpoint compatibility table for details on which models work with the Chat API. -
n
Integer n
How many chat completion choices to generate for each input message.integer or null, 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.Number or null, Optional, Defaults to 0
See more information about frequency and presence penalties.
-
responseFormat
RequestResponseFormat responseFormat
An object specifying the format that the model must output.Setting to { "type": "json_object" } enables JSON mode, which guarantees the message the model generates is valid JSON.
Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if finish_reason="length", which indicates the generation exceeded CreateChatCompletionRequest.maxTokens or the conversation exceeded the max context length.
object, Optional
-
seed
Integer seed
This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed, and you should refer to the system_fingerprint response parameter to monitor changes in the backend.integer or null, Optional
-
stop
String stop
Up to 4 sequences where the API will stop generating further tokens.string / array / null
Optional Defaults to null
-
stream
Boolean stream
If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message.boolean or null, 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 CreateChatCompletionRequest.topP but not both.
number or null, Optional
Defaults to 1
-
toolChoice
Object toolChoice
Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. Specifying a particular function via {"type: "function", "function": {"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.
string or object, Optional
string - none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. object - Specifies a tool the model should use. Use to force the model to call a specific function.
ToolChoice -
tools
List<Tool> tools
A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for.array Optional
See
Tool -
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 CreateChatCompletionRequest.temperature but not both.
number or null, Optional
Defaults to 1
-
user
String user
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn morestring, Optional
-
-
-
Class xyz.felh.openai.chat.RequestResponseFormat
class RequestResponseFormat extends Object implements Serializable-
Serialized Fields
-
type
RequestResponseFormat.TypeValue type
Must be one of text or json_object.String, Optional
Defaults to text, See
RequestResponseFormat.TypeValue
-
-
-
-
Package xyz.felh.openai.chat.tool
-
Class xyz.felh.openai.chat.tool.FunctionCall
class FunctionCall extends Object implements Serializable-
Serialized Fields
-
arguments
@NonNull String arguments
The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. -
name
@NonNull String name
The name of the function to call.
-
-
-
Class xyz.felh.openai.chat.tool.Tool
class Tool extends Object implements Serializable -
Class xyz.felh.openai.chat.tool.ToolCall
class ToolCall extends Object implements Serializable-
Serialized Fields
-
function
@NonNull FunctionCall function
The function that the model called.See
FunctionCall -
id
@NonNull String id
The ID of the tool call. -
type
@NonNull Type type
The type of the tool. Currently, only function is supported.See
Type
-
-
-
Class xyz.felh.openai.chat.tool.ToolChoice
class ToolChoice extends Object implements Serializable-
Serialized Fields
-
function
ToolChoice.Function function
function object -
type
Type type
The type of the tool. Currently, only function is supported.string, Optional
See
Type
-
-
-
Class xyz.felh.openai.chat.tool.ToolChoice.Function
class Function extends Object implements Serializable-
Serialized Fields
-
name
@NonNull String name
The name of the function to call.string
-
-
-
-
Package xyz.felh.openai.embedding
-
Class xyz.felh.openai.embedding.CreateEmbeddingRequest
class CreateEmbeddingRequest extends Object implements Serializable-
Serialized Fields
-
encodingFormat
CreateEmbeddingRequest.EncodingFormat encodingFormat
string Optional Defaults to floatThe format to return the embeddings in. Can be either float or base64. See
CreateEmbeddingRequest.EncodingFormat -
input
@NonNull Object input
string or array RequiredInput text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for text-embedding-ada-002), cannot be an empty string, and any array must be 2048 dimensions or less. Example Python code for counting tokens.
string string - The string that will be turned into an embedding.
array array - The array of strings that will be turned into an embedding. Each line's max is 8191
array array - The array of integers that will be turned into an embedding.
array array - The array of arrays containing integers that will be turned into an embedding.
-
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
OptionalA unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.
-
-
-
Class xyz.felh.openai.embedding.CreateEmbeddingResponse
class CreateEmbeddingResponse extends Object implements Serializable -
Class xyz.felh.openai.embedding.Embedding
class Embedding extends Object implements Serializable-
Serialized Fields
-
embedding
List<Double> embedding
The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the embedding guide. -
index
Integer index
The index of the embedding in the list of embeddings. -
object
String object
The object type, which is always "embedding".
-
-
-
-
Package xyz.felh.openai.file
-
Class xyz.felh.openai.file.File
class File extends OpenAiApiObjectWithId implements Serializable-
Serialized Fields
-
bytes
Long bytes
The size of the file, in bytes. -
createdAt
Long createdAt
The Unix timestamp (in seconds) for when the file was created. -
filename
String filename
The name of the file. -
purpose
File.Purpose purpose
The intended purpose of the file. Supported values are fine-tune, fine-tune-results, assistants, and assistants_output.See
File.Purposeassistants - Supported formats: ['c', 'cpp', 'csv', 'docx', 'html', 'java', 'json', 'md', 'pdf', 'php', 'pptx', 'py', 'rb', 'tex', 'txt', 'css', 'jpeg', 'jpg', 'js', 'gif', 'png', 'tar', 'ts', 'xlsx', 'xml', 'zip']
-
-
-
-
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
A string of up to 18 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 (in seconds) for when the fine-tuning job was created. -
error
FineTuningJobError error
For fine-tuning jobs that have failed, this will contain more information on the cause of the failure. -
fineTunedModel
String fineTunedModel
The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running. -
finishedAt
Long finishedAt
The Unix timestamp (in seconds) for when the fine-tuning job was finished. The value will be null if the fine-tuning job is still running. -
hyperparameters
Hyperparameters hyperparameters
The hyperparameters used for the fine-tuning job. See the fine-tuning guide for more details.See
Hyperparameters -
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 file ID(s) for the fine-tuning job. You can retrieve the results with the Files API. -
status
FineTuningJob.FineTuningJobStatus status
The current status of the fine-tuning job, which can be either validating_files, queued, 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.FineTuningJobError
class FineTuningJobError extends Object implements Serializable -
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
-
batchSize
Object batchSize
string or integer Optional Defaults to autoNumber of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
-
learningRateMultiplier
Object learningRateMultiplier
string or number Optional Defaults to autoScaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
-
nEpochs
Object nEpochs
string or integerThe 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.BaseRequest
class BaseRequest extends Object implements Serializable-
Serialized Fields
-
model
String model
The model to use for image generation.string, Optional Defaults to dall-e-2
When creating edit image
The model to use for image generation. Only dall-e-2 is supported at this time.
-
n
Integer n
The number of images to generate. Must be between 1 and 10. For dall-e-3, only n=1 is supported.integer or null, Optional
Defaults to 1
-
responseFormat
ImageResponseFormat responseFormat
The format in which the generated images are returned. Must be one of url or b64_json.string or null, Optional
Defaults to url
-
size
ImageSize size
The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024 for dall-e-2. Must be one of 1024x1024, 1792x1024, or 1024x1792 for dall-e-3string or null, Optional
Defaults to 1024x1024
See
ImageSize -
user
String user
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.string, Optional
-
-
-
Class xyz.felh.openai.image.CreateImageRequest
class CreateImageRequest extends BaseRequest implements Serializable-
Serialized Fields
-
prompt
@NonNull String prompt
A text description of the desired image(s). The maximum length is 1000 characters for dall-e-2 and 4000 characters for dall-e-3.string, Required
-
quality
ImageQuality quality
The quality of the image that will be generated. hd creates images with finer details and greater consistency across the image. This param is only supported for dall-e-3.string, Optional
Default to standard
See
ImageQuality -
style
ImageStyle style
The style of the generated images. Must be one of vivid or natural. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for dall-e-3.string or null, Optional
Defaults to vivid
See
ImageStyle
-
-
-
Class xyz.felh.openai.image.Image
class Image extends Object implements Serializable-
Serialized Fields
-
b64Json
String b64Json
The base64-encoded JSON of the generated image, if response_format is b64_json. -
revisedPrompt
String revisedPrompt
The prompt that was used to generate the image, if there was any revision to the prompt. -
url
String url
The URL of the generated image, if response_format is url (default).
-
-
-
Class xyz.felh.openai.image.ImageResponse
class ImageResponse extends Object implements Serializable
-
-
Package xyz.felh.openai.image.edit
-
Class xyz.felh.openai.image.edit.CreateEditRequest
class CreateEditRequest extends BaseRequest implements Serializable-
Serialized Fields
-
image
byte[] image
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.string, Required
-
imagePath
String imagePath
-
mask
byte[] mask
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.string, Optional
-
maskPath
String maskPath
-
prompt
@NonNull String prompt
A text description of the desired image(s). The maximum length is 1000 characters.string
-
-
-
-
Package xyz.felh.openai.image.variation
-
Class xyz.felh.openai.image.variation.CreateVariationRequest
class CreateVariationRequest extends BaseRequest implements Serializable-
Serialized Fields
-
image
byte[] image
The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.string, Required
-
imagePath
String imagePath
-
-
-
-
Package xyz.felh.openai.model
-
Class xyz.felh.openai.model.Model
class Model extends OpenAiApiObjectWithId implements Serializable
-
-
Package xyz.felh.openai.moderation
-
Class xyz.felh.openai.moderation.CreateModerationRequest
class CreateModerationRequest extends Object implements Serializable-
Serialized Fields
-
input
@NonNull Object input
string or array RequiredThe input text to classify
-
model
String model
Optional Defaults to text-moderation-latestTwo 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
The unique identifier for the moderation request. -
model
String model
The model used to generate the moderation results. -
results
List<Moderation> results
A list of moderation objects.See
Moderation
-
-
-
Class xyz.felh.openai.moderation.Moderation
class Moderation extends Object implements Serializable-
Serialized Fields
-
categories
ModerationCategories categories
A list of the categories, and whether they are flagged or not. -
categoryScores
ModerationCategoryScores categoryScores
A list of the categories along with their scores as predicted by model. -
flagged
Boolean flagged
Whether the content violates OpenAI's usage policies.
-
-
-
Class xyz.felh.openai.moderation.ModerationCategories
class ModerationCategories extends Object implements Serializable-
Serialized Fields
-
harassment
Boolean harassment
Content that expresses, incites, or promotes harassing language towards any target. -
harassmentThreatening
Boolean harassmentThreatening
Harassment content that also includes violence or serious harm towards any target. -
hate
Boolean hate
Content that expresses, incites, or promotes hate based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste. Hateful content aimed at non-protected groups (e.g., chess players) is harrassment. -
hateThreatening
Boolean hateThreatening
Hateful content that also includes violence or serious harm towards the targeted group based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste. -
selfHarm
Boolean selfHarm
Content that promotes, encourages, or depicts acts of self-harm, such as suicide, cutting, and eating disorders. -
selfHarmInstructions
Boolean selfHarmInstructions
Content that encourages performing acts of self-harm, such as suicide, cutting, and eating disorders, or that gives instructions or advice on how to commit such acts. -
selfHarmIntent
Boolean selfHarmIntent
Content where the speaker expresses that they are engaging or intend to engage in acts of self-harm, such as suicide, cutting, and eating disorders. -
sexual
Boolean sexual
Content meant to arouse sexual excitement, such as the description of sexual activity, or that promotes sexual services (excluding sex education and wellness). -
sexualMinors
Boolean sexualMinors
Sexual content that includes an individual who is under 18 years old. -
violence
Boolean violence
Content that depicts death, violence, or physical injury. -
violenceGraphic
Boolean violenceGraphic
Content that depicts death, violence, or physical injury in graphic detail.
-
-
-
Class xyz.felh.openai.moderation.ModerationCategoryScores
class ModerationCategoryScores extends Object implements Serializable-
Serialized Fields
-
harassment
Double harassment
The score for the category 'harassment'. -
harassmentThreatening
Double harassmentThreatening
The score for the category 'harassment/threatening'. -
hate
Double hate
The score for the category 'hate'. -
hateThreatening
Double hateThreatening
The score for the category 'hate/threatening'. -
selfHarm
Double selfHarm
The score for the category 'self-harm'. -
selfHarmInstructions
Double selfHarmInstructions
The score for the category 'self-harm/instructions'. -
selfHarmIntent
Double selfHarmIntent
The score for the category 'self-harm/intent'. -
sexual
Double sexual
The score for the category 'sexual'. -
sexualMinors
Double sexualMinors
The score for the category 'sexual/minors'. -
violence
Double violence
The score for the category 'violence'. -
violenceGraphic
Double violenceGraphic
The score for the category 'violence/graphic'.
-
-
-
-
Package xyz.felh.openai.thread
-
Class xyz.felh.openai.thread.CreateThreadRequest
class CreateThreadRequest extends Object implements Serializable-
Serialized Fields
-
messages
List<Message> messages
A list ofMessageto start the thread with.required fields: role, content
-
metadata
Map<String,
String> metadata Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
-
-
-
Class xyz.felh.openai.thread.ModifyThreadRequest
class ModifyThreadRequest extends Object implements Serializable-
Serialized Fields
-
-
Class xyz.felh.openai.thread.Thread
class Thread extends OpenAiApiObjectWithId implements Serializable-
Serialized Fields
-
createdAt
Integer createdAt
The Unix timestamp (in seconds) for when the thread was created. -
metadata
Map<String,
String> metadata Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
-
-
-
-
Package xyz.felh.openai.thread.message
-
Class xyz.felh.openai.thread.message.CreateMessageRequest
class CreateMessageRequest extends Object implements Serializable-
Serialized Fields
-
content
String content
The content of the message. -
fileIds
List<String> fileIds
A list ofFileIDs that the message should use. There can be a maximum of 10 files attached to a message. Useful for tools like retrieval and code_interpreter that can access and use files. -
metadata
Map<String,
String> metadata Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. -
role
@NonNull String role
The role of the entity that is creating the message. Currently only user is supported.
-
-
-
Class xyz.felh.openai.thread.message.Message
class Message extends OpenAiApiObjectWithId implements Serializable-
Serialized Fields
-
assistantId
String assistantId
If applicable, the ID of theAssistantthat authored this message. -
content
List<MessageContent> content
The content of the message in array of text and/or images.See
MessageContent -
createdAt
Integer createdAt
The Unix timestamp (in seconds) for when the thread was created. -
fileIds
List<String> fileIds
A list of file IDs that the assistant should use. Useful for tools like retrieval and code_interpreter that can access files. A maximum of 10 files can be attached to a message.See
File -
metadata
Map<String,
String> metadata Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. -
role
String role
The entity that produced the message. One of user or assistant.See
ChatMessageRole -
runId
String runId
If applicable, the ID of theRunassociated with the authoring of this message. -
threadId
String threadId
TheThreadID that this message belongs to.
-
-
-
Class xyz.felh.openai.thread.message.MessageContent
class MessageContent extends Object implements Serializable-
Serialized Fields
-
imageFile
MessageContent.ImageFile imageFile
References an imageFilein the content of a message. -
text
MessageContent.Text text
The text content that is part of a message. -
type
MessageContent.Type type
image_file or text
-
-
-
Class xyz.felh.openai.thread.message.ModifyMessageRequest
class ModifyMessageRequest extends Object implements Serializable-
Serialized Fields
-
-
-
Package xyz.felh.openai.thread.message.file
-
Class xyz.felh.openai.thread.message.file.MessageFile
class MessageFile extends OpenAiApiObjectWithId implements Serializable
-
-
Package xyz.felh.openai.thread.run
-
Class xyz.felh.openai.thread.run.CreateRunRequest
class CreateRunRequest extends Object implements Serializable-
Serialized Fields
-
assistantId
@NonNull String assistantId
The ID of theAssistantto use to execute this run. -
instructions
String instructions
Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. -
metadata
Map<String,
String> metadata Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. -
model
String model
The ID of the Model to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. -
tools
List<AssistantTool> tools
Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
-
-
-
Class xyz.felh.openai.thread.run.CreateThreadAndRunRequest
class CreateThreadAndRunRequest extends Object implements Serializable-
Serialized Fields
-
assistantId
@NonNull String assistantId
The ID of theAssistantto use to execute this run. -
instructions
String instructions
Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. -
metadata
Map<String,
String> metadata Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. -
model
String model
The ID of the Model to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. -
thread
Thread thread
SeeThread -
tools
List<AssistantTool> tools
Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
-
-
-
Class xyz.felh.openai.thread.run.LastError
class LastError extends Object implements Serializable -
Class xyz.felh.openai.thread.run.ModifyRunRequest
class ModifyRunRequest extends Object implements Serializable-
Serialized Fields
-
-
Class xyz.felh.openai.thread.run.RequiredAction
class RequiredAction extends Object implements Serializable-
Serialized Fields
-
submitToolOutputs
RequiredAction.ToolOutput submitToolOutputs
Details on the tool outputs needed for this run to continue. -
type
String type
For now, this is always submit_tool_outputs.
-
-
-
Class xyz.felh.openai.thread.run.Run
class Run extends OpenAiApiObjectWithId implements Serializable-
Serialized Fields
-
assistantId
String assistantId
The ID of theAssistantused for execution of this run. -
cancelledAt
Integer cancelledAt
The Unix timestamp (in seconds) for when the run was cancelled. -
completedAt
Integer completedAt
The Unix timestamp (in seconds) for when the run was completed. -
createdAt
Integer createdAt
The Unix timestamp (in seconds) for when the run was created. -
expiresAt
Integer expiresAt
The Unix timestamp (in seconds) for when the run will expire. -
failedAt
Integer failedAt
The Unix timestamp (in seconds) for when the run failed. -
fileIds
List<String> fileIds
-
instructions
String instructions
The instructions that theAssistantused for this run. -
lastError
LastError lastError
The last error associated with this run. Will be null if there are no errors.See
LastError -
metadata
Map<String,
String> metadata Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. -
model
String model
The model that theAssistantused for this run. -
requiredAction
RequiredAction requiredAction
Details on the action required to continue the run. Will be null if no action is required.See
RequiredAction -
startedAt
Integer startedAt
The Unix timestamp (in seconds) for when the run was started. -
status
Run.Status status
The status of the run, which can be either queued, in_progress, requires_action, cancelling, cancelled, failed, completed, or expired. SeeRun.Status -
threadId
String threadId
The ID of theThreadthat was executed on as a part of this run. -
tools
List<AssistantTool> tools
The list of tools that theAssistantused for this run.See
AssistantTool
-
-
-
Class xyz.felh.openai.thread.run.SubmitToolOutputsRequest
class SubmitToolOutputsRequest extends Object implements Serializable-
Serialized Fields
-
toolOutputs
@NonNull List<ToolOutput> toolOutputs
A list of tools for which the outputs are being submitted.See
ToolOutput
-
-
-
Class xyz.felh.openai.thread.run.Thread
class Thread extends Object implements Serializable-
Serialized Fields
-
messages
List<Message> messages
A list of messages to start the thread with.See
Messagerole and content is required
-
metadata
Map<String,
String> metadata Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
-
-
-
Class xyz.felh.openai.thread.run.ToolOutput
class ToolOutput extends Object implements Serializable
-
-
Package xyz.felh.openai.thread.run.step
-
Class xyz.felh.openai.thread.run.step.RunStep
class RunStep extends OpenAiApiObjectWithId implements Serializable-
Serialized Fields
-
assistantId
String assistantId
The ID of theAssistantassociated with the run step. -
cancelledAt
Integer cancelledAt
The Unix timestamp (in seconds) for when the run step was cancelled. -
completedAt
Integer completedAt
The Unix timestamp (in seconds) for when the run step completed. -
createdAt
Integer createdAt
The Unix timestamp (in seconds) for when the run step was created. -
expiredAt
Integer expiredAt
The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. -
failedAt
Integer failedAt
The Unix timestamp (in seconds) for when the run step failed. -
lastError
LastError lastError
The last error associated with this run step. Will be null if there are no errors.See
LastError -
metadata
Map<String,
String> metadata Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. -
runId
String runId
The ID of theRunthat this run step is a part of. -
status
RunStep.Status status
The status of the run step, which can be either in_progress, cancelled, failed, completed, or expired. -
stepDetails
StepDetails stepDetails
The details of the run step.See
StepDetails -
threadId
String threadId
The ID of theThreadthat was run. -
type
RunStep.Type type
The type of run step, which can be either message_creation or tool_calls.
-
-
-
Class xyz.felh.openai.thread.run.step.StepDetails
class StepDetails extends Object implements Serializable-
Serialized Fields
-
messageCreation
StepDetails.MessageCreation messageCreation
Details of the message creation by the run step. -
toolCalls
List<StepToolCall> toolCalls
An array of tool calls the run step was involved in. These can be associated with one of three types of tools: code_interpreter, retrieval, or function.See
StepToolCall -
type
String type
message_creation, tool_calls
-
-
-
Class xyz.felh.openai.thread.run.step.StepDetails.MessageCreation
class MessageCreation extends Object implements Serializable-
Serialized Fields
-
messageId
String messageId
The ID of the message that was created by this run step.
-
-
-
Class xyz.felh.openai.thread.run.step.StepToolCall
class StepToolCall extends Object implements Serializable-
Serialized Fields
-
codeInterpreter
StepToolCall.CodeInterpreter codeInterpreter
The Code Interpreter tool call definition. -
function
StepToolCall.Function function
type = function The definition of the function that was called. -
id
String id
The ID of the tool call object. -
retrieval
Map<?,
?> retrieval type = retrieval -
type
String type
The type of tool call. This is always going to be code_interpreter/retrieval/function for this type of tool call.
-
-
-
Class xyz.felh.openai.thread.run.step.StepToolCall.CodeInterpreter
class CodeInterpreter extends Object implements Serializable-
Serialized Fields
-
input
String input
The input to the Code Interpreter tool call. -
outputs
List<StepToolCall.CodeInterpreterOutput> outputs
The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (logs) or images (image). Each of these are represented by a different object type.
-
-
-
Class xyz.felh.openai.thread.run.step.StepToolCall.CodeInterpreterOutput
class CodeInterpreterOutput extends Object implements Serializable-
Serialized Fields
-
image
StepToolCall.CodeInterpreterOutputImage image
type = image -
logs
String logs
type = logs -
type
String type
logs or image
-
-
-
Class xyz.felh.openai.thread.run.step.StepToolCall.CodeInterpreterOutputImage
class CodeInterpreterOutputImage extends Object implements Serializable -
Class xyz.felh.openai.thread.run.step.StepToolCall.Function
class Function extends Object implements Serializable
-