1313// See the License for the specific language governing permissions and
1414// limitations under the License.
1515
16- use std:: collections:: HashMap ;
17-
1816use derive_builder:: Builder ;
1917use dynamo_runtime:: protocols:: annotated:: AnnotationsProvider ;
2018use serde:: { Deserialize , Serialize } ;
@@ -92,7 +90,7 @@ pub struct CompletionChoice {
9290
9391 #[ serde( skip_serializing_if = "Option::is_none" ) ]
9492 #[ builder( default , setter( strip_option) ) ]
95- pub logprobs : Option < LogprobResult > ,
93+ pub logprobs : Option < async_openai :: types :: Logprobs > ,
9694}
9795
9896impl ContentProvider for CompletionChoice {
@@ -107,16 +105,6 @@ impl CompletionChoice {
107105 }
108106}
109107
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-
120108pub fn prompt_to_string ( prompt : & async_openai:: types:: Prompt ) -> String {
121109 match prompt {
122110 async_openai:: types:: Prompt :: String ( s) => s. clone ( ) ,
0 commit comments