@@ -2,8 +2,6 @@ use std::fmt::Display;
2
2
3
3
use bytes:: Bytes ;
4
4
5
- use crate :: { error:: OpenAIError , types:: InputSource , util:: create_file_part} ;
6
-
7
5
use super :: {
8
6
AddUploadPartRequest , AudioInput , AudioResponseFormat , ChatCompletionFunctionCall ,
9
7
ChatCompletionFunctions , ChatCompletionNamedToolChoice , ChatCompletionRequestAssistantMessage ,
@@ -14,13 +12,14 @@ use super::{
14
12
ChatCompletionRequestSystemMessage , ChatCompletionRequestSystemMessageContent ,
15
13
ChatCompletionRequestToolMessage , ChatCompletionRequestToolMessageContent ,
16
14
ChatCompletionRequestUserMessage , ChatCompletionRequestUserMessageContent ,
17
- ChatCompletionRequestUserMessageContentPart , ChatCompletionToolChoiceOption , CreateFileRequest , CreateImageEditRequest ,
18
- CreateImageVariationRequest , CreateMessageRequestContent , CreateTranscriptionRequest ,
19
- CreateTranslationRequest , DallE2ImageSize , EmbeddingInput , FileInput , FilePurpose ,
20
- FunctionName , ImageInput , ImageModel , ImageResponseFormat , ImageSize , ImageUrl ,
21
- ModerationInput , Prompt , Role , Stop ,
22
- TimestampGranularity ,
15
+ ChatCompletionRequestUserMessageContentPart , ChatCompletionToolChoiceOption , CreateFileRequest ,
16
+ CreateImageEditRequest , CreateImageVariationRequest , CreateMessageRequestContent ,
17
+ CreateTranscriptionRequest , CreateTranslationRequest , DallE2ImageSize , EmbeddingInput ,
18
+ FileInput , FilePurpose , FunctionName , ImageInput , ImageModel , ImageResponseFormat , ImageSize ,
19
+ ImageUrl , ModerationInput , Prompt , Role , Stop , TimestampGranularity ,
23
20
} ;
21
+ use crate :: util:: async_convert:: AsyncTryFrom ;
22
+ use crate :: { error:: OpenAIError , types:: InputSource , util:: create_file_part} ;
24
23
25
24
/// for `impl_from!(T, Enum)`, implements
26
25
/// - `From<T>`
@@ -742,8 +741,7 @@ impl Default for ChatCompletionRequestToolMessageContent {
742
741
743
742
// start: types to multipart from
744
743
745
- #[ async_convert:: async_trait]
746
- impl async_convert:: TryFrom < CreateTranscriptionRequest > for reqwest:: multipart:: Form {
744
+ impl AsyncTryFrom < CreateTranscriptionRequest > for reqwest:: multipart:: Form {
747
745
type Error = OpenAIError ;
748
746
749
747
async fn try_from ( request : CreateTranscriptionRequest ) -> Result < Self , Self :: Error > {
@@ -779,8 +777,7 @@ impl async_convert::TryFrom<CreateTranscriptionRequest> for reqwest::multipart::
779
777
}
780
778
}
781
779
782
- #[ async_convert:: async_trait]
783
- impl async_convert:: TryFrom < CreateTranslationRequest > for reqwest:: multipart:: Form {
780
+ impl AsyncTryFrom < CreateTranslationRequest > for reqwest:: multipart:: Form {
784
781
type Error = OpenAIError ;
785
782
786
783
async fn try_from ( request : CreateTranslationRequest ) -> Result < Self , Self :: Error > {
@@ -805,8 +802,7 @@ impl async_convert::TryFrom<CreateTranslationRequest> for reqwest::multipart::Fo
805
802
}
806
803
}
807
804
808
- #[ async_convert:: async_trait]
809
- impl async_convert:: TryFrom < CreateImageEditRequest > for reqwest:: multipart:: Form {
805
+ impl AsyncTryFrom < CreateImageEditRequest > for reqwest:: multipart:: Form {
810
806
type Error = OpenAIError ;
811
807
812
808
async fn try_from ( request : CreateImageEditRequest ) -> Result < Self , Self :: Error > {
@@ -847,8 +843,7 @@ impl async_convert::TryFrom<CreateImageEditRequest> for reqwest::multipart::Form
847
843
}
848
844
}
849
845
850
- #[ async_convert:: async_trait]
851
- impl async_convert:: TryFrom < CreateImageVariationRequest > for reqwest:: multipart:: Form {
846
+ impl AsyncTryFrom < CreateImageVariationRequest > for reqwest:: multipart:: Form {
852
847
type Error = OpenAIError ;
853
848
854
849
async fn try_from ( request : CreateImageVariationRequest ) -> Result < Self , Self :: Error > {
@@ -882,8 +877,7 @@ impl async_convert::TryFrom<CreateImageVariationRequest> for reqwest::multipart:
882
877
}
883
878
}
884
879
885
- #[ async_convert:: async_trait]
886
- impl async_convert:: TryFrom < CreateFileRequest > for reqwest:: multipart:: Form {
880
+ impl AsyncTryFrom < CreateFileRequest > for reqwest:: multipart:: Form {
887
881
type Error = OpenAIError ;
888
882
889
883
async fn try_from ( request : CreateFileRequest ) -> Result < Self , Self :: Error > {
@@ -895,8 +889,7 @@ impl async_convert::TryFrom<CreateFileRequest> for reqwest::multipart::Form {
895
889
}
896
890
}
897
891
898
- #[ async_convert:: async_trait]
899
- impl async_convert:: TryFrom < AddUploadPartRequest > for reqwest:: multipart:: Form {
892
+ impl AsyncTryFrom < AddUploadPartRequest > for reqwest:: multipart:: Form {
900
893
type Error = OpenAIError ;
901
894
902
895
async fn try_from ( request : AddUploadPartRequest ) -> Result < Self , Self :: Error > {
0 commit comments