@@ -13,23 +13,7 @@ use crate::{
13
13
14
14
use bytes:: Bytes ;
15
15
16
- use super :: {
17
- AddUploadPartRequest , AudioInput , AudioResponseFormat , ChatCompletionFunctionCall ,
18
- ChatCompletionFunctions , ChatCompletionNamedToolChoice , ChatCompletionRequestAssistantMessage ,
19
- ChatCompletionRequestAssistantMessageContent , ChatCompletionRequestDeveloperMessage ,
20
- ChatCompletionRequestDeveloperMessageContent , ChatCompletionRequestFunctionMessage ,
21
- ChatCompletionRequestMessage , ChatCompletionRequestMessageContentPartAudio ,
22
- ChatCompletionRequestMessageContentPartImage , ChatCompletionRequestMessageContentPartText ,
23
- ChatCompletionRequestSystemMessage , ChatCompletionRequestSystemMessageContent ,
24
- ChatCompletionRequestToolMessage , ChatCompletionRequestToolMessageContent ,
25
- ChatCompletionRequestUserMessage , ChatCompletionRequestUserMessageContent ,
26
- ChatCompletionRequestUserMessageContentPart , ChatCompletionToolChoiceOption , CreateFileRequest ,
27
- CreateImageEditRequest , CreateImageVariationRequest , CreateMessageRequestContent ,
28
- CreateSpeechResponse , CreateTranscriptionRequest , CreateTranslationRequest , DallE2ImageSize ,
29
- EmbeddingInput , FileInput , FilePurpose , FunctionName , Image , ImageInput , ImageModel ,
30
- ImageResponseFormat , ImageSize , ImageUrl , ImagesResponse , ModerationInput , Prompt , Role , Stop ,
31
- TimestampGranularity ,
32
- } ;
16
+ use super :: { AddUploadPartRequest , AudioInput , AudioResponseFormat , ChatCompletionFunctionCall , ChatCompletionFunctions , ChatCompletionNamedToolChoice , ChatCompletionRequestAssistantMessage , ChatCompletionRequestAssistantMessageContent , ChatCompletionRequestDeveloperMessage , ChatCompletionRequestDeveloperMessageContent , ChatCompletionRequestFunctionMessage , ChatCompletionRequestMessage , ChatCompletionRequestMessageContentPartAudio , ChatCompletionRequestMessageContentPartImage , ChatCompletionRequestMessageContentPartText , ChatCompletionRequestSystemMessage , ChatCompletionRequestSystemMessageContent , ChatCompletionRequestToolMessage , ChatCompletionRequestToolMessageContent , ChatCompletionRequestUserMessage , ChatCompletionRequestUserMessageContent , ChatCompletionRequestUserMessageContentPart , ChatCompletionToolChoiceOption , CreateFileRequest , CreateImageEditRequest , CreateImageVariationRequest , CreateMessageRequestContent , CreateSpeechResponse , CreateTranscriptionRequest , CreateTranslationRequest , DallE2ImageSize , EmbeddingInput , FileInput , FilePurpose , FunctionName , Image , ImageInput , ImageModel , ImageResponseFormat , ImageSize , ImageUrl , ImagesResponse , InputContent , ModerationInput , Prompt , ResponseInput , ResponsesRole , Role , Stop , TimestampGranularity } ;
33
17
34
18
/// for `impl_from!(T, Enum)`, implements
35
19
/// - `From<T>`
@@ -987,3 +971,46 @@ impl AsyncTryFrom<AddUploadPartRequest> for reqwest::multipart::Form {
987
971
}
988
972
989
973
// end: types to multipart form
974
+
975
+ impl Default for ResponseInput {
976
+ fn default ( ) -> Self {
977
+ Self :: Text ( "" . to_string ( ) )
978
+ }
979
+ }
980
+
981
+ impl Default for InputContent {
982
+ fn default ( ) -> Self {
983
+ Self :: TextInput ( "" . to_string ( ) )
984
+ }
985
+ }
986
+
987
+
988
+ impl From < String > for ResponseInput {
989
+ fn from ( value : String ) -> Self {
990
+ ResponseInput :: Text ( value)
991
+ }
992
+ }
993
+
994
+ impl From < & str > for ResponseInput {
995
+ fn from ( value : & str ) -> Self {
996
+ ResponseInput :: Text ( value. to_owned ( ) )
997
+ }
998
+ }
999
+
1000
+ impl Default for ResponsesRole {
1001
+ fn default ( ) -> Self {
1002
+ Self :: User
1003
+ }
1004
+ }
1005
+
1006
+ impl From < String > for InputContent {
1007
+ fn from ( value : String ) -> Self {
1008
+ Self :: TextInput ( value)
1009
+ }
1010
+ }
1011
+
1012
+ impl From < & str > for InputContent {
1013
+ fn from ( value : & str ) -> Self {
1014
+ Self :: TextInput ( value. to_owned ( ) )
1015
+ }
1016
+ }
0 commit comments