Skip to content
OutSystemsExpertsPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

VertexAILibrary — ODC External Library

Google Vertex AI integration for OutSystems Developer Cloud (ODC).
Exposes calls as Server Actions you can drag into any ODC app or library.


Setup

1. Create a Google Cloud Service Account

# Create the service account
gcloud iam service-accounts create odc-vertex-ai \
    --display-name="ODC Vertex AI"

# Grant Vertex AI User role
gcloud projects add-iam-policy-binding YOUR_PROJECT_ID \
    --member="serviceAccount:odc-vertex-ai@YOUR_PROJECT_ID.iam.gserviceaccount.com" \
    --role="roles/aiplatform.user"

# Download the JSON key
gcloud iam service-accounts keys create sa-key.json \
    --iam-account=odc-vertex-ai@YOUR_PROJECT_ID.iam.gserviceaccount.com

Store the full contents of sa-key.json in an ODC Secret or Settings value.
Never hard-code it in your app.

2. Enable the Vertex AI API

gcloud services enable aiplatform.googleapis.com

3. Choose a region (data residency)

Call GetSupportedRegions to list valid values. Besides single regions (e.g. europe-west4), the library supports the multi-regions eu and us, and the global endpoint:

Region Host Request path
europe-west4 europe-west4-aiplatform.googleapis.com projects/<PROJECT_ID>/locations/europe-west4/...
eu aiplatform.eu.rep.googleapis.com projects/<PROJECT_ID>/locations/eu/...
us aiplatform.us.rep.googleapis.com projects/<PROJECT_ID>/locations/us/...
global aiplatform.googleapis.com projects/<PROJECT_ID>/locations/global/...

Use eu when EU data residency is mandatory. global does not guarantee data residency (requests may be served from any region), so don't use it when residency is required.

4. Choose a publisher

Every generation action takes a Publisher parameter (call GetSupportedPublishers for valid values):

Publisher Models (examples) Transport
google gemini-2.0-flash-001 gRPC GenerateContent
anthropic claude-sonnet-4@20250514 rawPredict (Anthropic Messages format)

Model availability varies by publisher and region; Claude models must be enabled in the Vertex AI Model Garden for your project, and are not offered in every region.

Token usage outputs

GenerateContent and GenerateContentWithSystemPrompt return the token usage of the call as extra outputs, for cost allocation:

Output Google (usageMetadata) Anthropic (usage)
InputTokens promptTokenCount input_tokens
OutputTokens candidatesTokenCount output_tokens
CachedInputTokens 0 (not exposed by the SDK) cache_read_input_tokens
CacheCreationInputTokens 0 cache_creation_input_tokens
ThinkingTokens totalTokenCount − promptTokenCount − candidatesTokenCount 0 (included in OutputTokens)
TotalTokens totalTokenCount sum of all of the above input/output counts

5. Build & Package for ODC

# Restore packages
dotnet restore

# Publish (self-contained, no runtime needed in ODC)
dotnet publish -c Release -o ./publish

# Zip the publish output — this is what you upload to ODC Portal
cd publish
zip -r ../VertexAILibrary.zip .

6. Upload to ODC Portal

  1. Open ODC Portal → Integrate → External Libraries
  2. Click Upload
  3. Select VertexAILibrary.zip
  4. Wait for validation and publishing to complete

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages