Skip to content

Commit

Permalink
remove extra fullModelName
Browse files Browse the repository at this point in the history
  • Loading branch information
David Motsonashvili committed Jun 7, 2024
1 parent 6c5b1bb commit f26b607
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import android.graphics.Bitmap
import com.google.ai.client.generativeai.common.APIController
import com.google.ai.client.generativeai.common.CountTokensRequest
import com.google.ai.client.generativeai.common.GenerateContentRequest
import com.google.ai.client.generativeai.common.util.fullModelName
import com.google.ai.client.generativeai.internal.util.toInternal
import com.google.ai.client.generativeai.internal.util.toPublic
import com.google.ai.client.generativeai.type.Content
Expand Down Expand Up @@ -252,14 +253,4 @@ internal constructor(
.firstOrNull { it != FinishReason.STOP }
?.let { throw ResponseStoppedException(this) }
}

companion object {
/**
* Ensures the model name provided has a `models/` prefix
*
* Models must be prepended with the `models/` prefix when communicating with the backend.
*/
private fun fullModelName(name: String): String =
name.takeIf { it.contains("/") } ?: "models/$name"
}
}

0 comments on commit f26b607

Please sign in to comment.