A port of the Vertex API Gemini demos by Mete Atamel to Rust.
- Enable the Vertex AI API in the Cloud Console.
- Install the Google Cloud SDK is insalled and configured and that you are logged in into an account with the Vertex API enabled in the Cloud Console. You can use
gcloud auth login
to log in. - Ensure you have the following environment variables set:
API_ENDPOINT
: The endpoint of the Vertex AI API.PROJECT_ID
: The ID of the project to use.LOCATION_ID
: The ID of the location to use (also called region).
Alternatively, create .cargo/config.toml
with the following content:
[env]
API_ENDPOINT="<api endpoint>"
PROJECT_ID="<project id>"
LOCATION_ID="<location id (also called region)"
- Run one of the demos:
generate-text-from-image-gcs
: Generates text from an image in Google Could Storage.generate-text-from-image-local
: Generate text from an local image.generate-text-from-text
: Generate text from text.
Run with cargo run --bin <demo name>
.