Skip to content

Commit

Permalink
Move RequestOptions conversion to conversions.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
rlazo committed Mar 19, 2024
1 parent a3e98ad commit 77a7e28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,7 @@ internal constructor(
APIController(
apiKey,
modelName,
com.google.ai.client.generativeai.common.RequestOptions(
requestOptions.timeout,
requestOptions.apiVersion
)
requestOptions.toInternal()
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import android.graphics.BitmapFactory
import android.util.Base64
import com.google.ai.client.generativeai.common.CountTokensResponse
import com.google.ai.client.generativeai.common.GenerateContentResponse
import com.google.ai.client.generativeai.common.RequestOptions
import com.google.ai.client.generativeai.common.client.GenerationConfig
import com.google.ai.client.generativeai.common.server.BlockReason
import com.google.ai.client.generativeai.common.server.Candidate
Expand All @@ -46,6 +47,9 @@ import java.io.ByteArrayOutputStream

private const val BASE_64_FLAGS = Base64.NO_WRAP

internal fun com.google.ai.client.generativeai.type.RequestOptions.toInternal() =
RequestOptions(timeout, apiVersion)

internal fun com.google.ai.client.generativeai.type.Content.toInternal() =
Content(this.role, this.parts.map { it.toInternal() })

Expand Down

0 comments on commit 77a7e28

Please sign in to comment.