@@ -634,8 +634,8 @@ func (c *Client) CreateEmbedding(ctx context.Context, text string) (*base.Embedd
634634 copy (embedding , embedding32 )
635635
636636 // Extract usage information
637- inputTokens := int ( response .Usage .PromptTokens )
638- totalTokens := int ( response .Usage .TotalTokens )
637+ inputTokens := response .Usage .PromptTokens
638+ totalTokens := response .Usage .TotalTokens
639639
640640 // DMR is local/free, so cost is 0
641641 cost := 0.0
@@ -657,10 +657,7 @@ func (c *Client) CreateEmbedding(ctx context.Context, text string) (*base.Embedd
657657func (c * Client ) CreateBatchEmbedding (ctx context.Context , texts []string ) (* base.BatchEmbeddingResult , error ) {
658658 if len (texts ) == 0 {
659659 return & base.BatchEmbeddingResult {
660- Embeddings : [][]float64 {},
661- InputTokens : 0 ,
662- TotalTokens : 0 ,
663- Cost : 0 ,
660+ Embeddings : [][]float64 {},
664661 }, nil
665662 }
666663
@@ -693,8 +690,8 @@ func (c *Client) CreateBatchEmbedding(ctx context.Context, texts []string) (*bas
693690 }
694691
695692 // Extract usage information
696- inputTokens := int ( response .Usage .PromptTokens )
697- totalTokens := int ( response .Usage .TotalTokens )
693+ inputTokens := response .Usage .PromptTokens
694+ totalTokens := response .Usage .TotalTokens
698695
699696 // DMR is local/free, so cost is 0
700697 cost := 0.0
0 commit comments