OpenAIFile Class

  • java.lang.Object
    • com.azure.ai.openai.models.OpenAIFile

Implements

public final class OpenAIFile
implements JsonSerializable<OpenAIFile>

Represents an assistant that can call the model and use tools.

Method Summary

Modifier and Type Method and Description
static OpenAIFile fromJson(JsonReader jsonReader)

Reads an instance of OpenAIFile from the JsonReader.

int getBytes()

Get the bytes property: The size of the file, in bytes.

OffsetDateTime getCreatedAt()

Get the createdAt property: The Unix timestamp, in seconds, representing when this object was created.

String getFilename()

Get the filename property: The name of the file.

String getId()

Get the id property: The identifier, which can be referenced in API endpoints.

String getObject()

Get the object property: The object type, which is always 'file'.

FilePurpose getPurpose()

Get the purpose property: The intended purpose of a file.

FileState getStatus()

Get the status property: The state of the file.

String getStatusDetails()

Get the statusDetails property: The error message with details in case processing of this file failed.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Method Details

fromJson

public static OpenAIFile fromJson(JsonReader jsonReader)

Reads an instance of OpenAIFile from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of OpenAIFile if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getBytes

public int getBytes()

Get the bytes property: The size of the file, in bytes.

Returns:

the bytes value.

getCreatedAt

public OffsetDateTime getCreatedAt()

Get the createdAt property: The Unix timestamp, in seconds, representing when this object was created.

Returns:

the createdAt value.

getFilename

public String getFilename()

Get the filename property: The name of the file.

Returns:

the filename value.

getId

public String getId()

Get the id property: The identifier, which can be referenced in API endpoints.

Returns:

the id value.

getObject

public String getObject()

Get the object property: The object type, which is always 'file'.

Returns:

the object value.

getPurpose

public FilePurpose getPurpose()

Get the purpose property: The intended purpose of a file.

Returns:

the purpose value.

getStatus

public FileState getStatus()

Get the status property: The state of the file. This field is available in Azure OpenAI only.

Returns:

the status value.

getStatusDetails

public String getStatusDetails()

Get the statusDetails property: The error message with details in case processing of this file failed. This field is available in Azure OpenAI only.

Returns:

the statusDetails value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to