+ * https://beta.openai.com/docs/api-reference/files + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class FileResponse { + + /** + * 文件的唯一ID + * The unique id of this file. + */ + private String id; + + /** + * 返回的对象类型,应为 "file" + * The type of object returned, should be "file". + */ + private String object; + + /** + * 文件大小(以字节为单位) + * File size in bytes. + */ + private Long bytes; + + /** + * 创建时间(以秒为单位的纪元时间) + * The creation time in epoch seconds. + */ + @JsonProperty("created_at") + private Long createdAt; + + /** + * 文件名 + * The name of the file. + */ + private String filename; + + /** + * 文件用途的描述 + * Description of the file's purpose. + */ + private String purpose; + + /** + * 文件的当前状态,可以是 uploaded, processed, pending, error, deleting 或 deleted + * The current status of the file, which can be either uploaded, processed, pending, error, deleting or deleted. + */ + private String status; + + /** + * 文件状态的附加详细信息 + * 如果文件处于错误状态,这将包括描述错误的消息 + * Additional details about the status of the file. + * If the file is in the error state, this will include a message describing the error. + */ + @JsonProperty("status_details") + private String statusDetails; + + +} diff --git a/src/main/java/com/plexpt/chatgpt/entity/audio/SpeechRequest.java b/src/main/java/com/plexpt/chatgpt/entity/audio/SpeechRequest.java new file mode 100644 index 0000000..828fd5a --- /dev/null +++ b/src/main/java/com/plexpt/chatgpt/entity/audio/SpeechRequest.java @@ -0,0 +1,66 @@ +package com.plexpt.chatgpt.entity.audio; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +/** + * 语音请求对象 + * Speech request object + */ +@Data +@Builder +@Slf4j +@AllArgsConstructor +@NoArgsConstructor(force = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public class SpeechRequest { + + /** + * 模型 + * Model https://platform.openai.com/docs/models/tts + * + * One of the available TTS models: tts-1 or tts-1-hd + */ + @Builder.Default + private String model = "tts-1"; + + /** + * 输入文本 + * Input text + * The text to generate audio for. The maximum length is 4096 characters. + */ + private String input; + + /** + * 声音 + * 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. + * + * https://platform.openai.com/docs/guides/text-to-speech/voice-options + */ + @Builder.Default + private String voice ="alloy"; + + /** + * 响应格式 + * Response format + * The format to audio in. Supported formats are mp3, opus, aac, flac, wav, and pcm. + */ + private String response_format; + + /** + * 速度 + * Speed + * + * The speed of the generated audio. Select a value from 0.25 to 4.0. 1.0 is the default. + */ + private Double speed; + +} diff --git a/src/main/java/com/plexpt/chatgpt/entity/chat/ChatCompletion.java b/src/main/java/com/plexpt/chatgpt/entity/chat/ChatCompletion.java index db1215b..3edea9a 100644 --- a/src/main/java/com/plexpt/chatgpt/entity/chat/ChatCompletion.java +++ b/src/main/java/com/plexpt/chatgpt/entity/chat/ChatCompletion.java @@ -169,18 +169,12 @@ public interface Model { * gpt-3.5-turbo */ String GPT_3_5_TURBO = "gpt-3.5-turbo"; - String GPT_3_5_TURBO_16K = "gpt-3.5-turbo-16k"; - String GPT_3_5_TURBO_INSTRUCT = "gpt-3.5-turbo-instruct"; /** * GPT4.0 */ String GPT4 = "gpt-4"; - String GPT4V = "gpt-4-vision-preview"; String GPT4o = "gpt-4o"; - /** - * GPT4.0 超长上下文 - */ - String GPT_4_32K = "gpt-4-32k"; + String GPT4oMini = "gpt-4o-mini"; }