Skip to content

Commit

Permalink
Make v1beta the default api version (#123)
Browse files Browse the repository at this point in the history
Also, update the README to use gemini-1.5-pro-latest
  • Loading branch information
rlazo authored Apr 19, 2024
1 parent 2d9f5db commit 9476b4f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ For example, with just a few lines of code, you can access Gemini's multimodal c

```kotlin
val generativeModel = GenerativeModel(
modelName = "gemini-1.0-pro-vision-latest",
modelName = "gemini-1.5-pro-latest",
apiKey = BuildConfig.apiKey
)

Expand All @@ -30,15 +30,15 @@ print(response.text)

This repository contains a sample app demonstrating how the SDK can access and utilize the Gemini model for various use cases.

To try out the sample app you can directly import the project from Android Studio
To try out the sample app you can directly import the project from Android Studio
via **File > New > Import Sample** and searching for *Generative AI Sample* or follow these steps below:

1. Check out this repository.\
`git clone https://github.com/google/generative-ai-android`

1. [Obtain an API key](https://makersuite.google.com/app/apikey) to use with the Google AI SDKs.

1. Open and build the sample app in the `generativeai-android-sample` folder of this repo.
1. Open and build the sample app in the `generativeai-android-sample` folder of this repo.

1. Paste your API key into the `apiKey` property in the `local.properties` file.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ import kotlin.time.toDuration
*/
class RequestOptions(
val timeout: Duration,
val apiVersion: String = "v1",
val apiVersion: String = "v1beta",
val endpoint: String = "https://generativelanguage.googleapis.com",
) {
@JvmOverloads
constructor(
timeout: Long? = HttpTimeout.INFINITE_TIMEOUT_MS,
apiVersion: String = "v1",
apiVersion: String = "v1beta",
endpoint: String = "https://generativelanguage.googleapis.com",
) : this(
(timeout ?: HttpTimeout.INFINITE_TIMEOUT_MS).toDuration(DurationUnit.MILLISECONDS),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ import kotlin.time.toDuration
*/
class RequestOptions(
val timeout: Duration,
val apiVersion: String = "v1",
val apiVersion: String = "v1beta",
) {
@JvmOverloads
constructor(
timeout: Long? = Long.MAX_VALUE,
apiVersion: String = "v1",
apiVersion: String = "v1beta",
) : this(
(timeout ?: Long.MAX_VALUE).toDuration(DurationUnit.MILLISECONDS),
apiVersion,
Expand Down

0 comments on commit 9476b4f

Please sign in to comment.