13
13
// See the License for the specific language governing permissions and
14
14
// limitations under the License.
15
15
16
- use std:: collections:: HashMap ;
17
-
18
16
use derive_builder:: Builder ;
19
17
use dynamo_runtime:: protocols:: annotated:: AnnotationsProvider ;
20
18
use serde:: { Deserialize , Serialize } ;
@@ -92,7 +90,7 @@ pub struct CompletionChoice {
92
90
93
91
#[ serde( skip_serializing_if = "Option::is_none" ) ]
94
92
#[ builder( default , setter( strip_option) ) ]
95
- pub logprobs : Option < LogprobResult > ,
93
+ pub logprobs : Option < async_openai :: types :: Logprobs > ,
96
94
}
97
95
98
96
impl ContentProvider for CompletionChoice {
@@ -107,16 +105,6 @@ impl CompletionChoice {
107
105
}
108
106
}
109
107
110
- // TODO: validate this is the correct format
111
- /// Legacy OpenAI LogprobResult component
112
- #[ derive( Clone , Debug , Deserialize , Serialize ) ]
113
- pub struct LogprobResult {
114
- pub tokens : Vec < String > ,
115
- pub token_logprobs : Vec < f32 > ,
116
- pub top_logprobs : Vec < HashMap < String , f32 > > ,
117
- pub text_offset : Vec < i32 > ,
118
- }
119
-
120
108
pub fn prompt_to_string ( prompt : & async_openai:: types:: Prompt ) -> String {
121
109
match prompt {
122
110
async_openai:: types:: Prompt :: String ( s) => s. clone ( ) ,
0 commit comments