Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions mmv1/products/firebaseailogic/PromptTemplate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ references:
api: 'https://firebase.google.com/docs/reference/ai-logic/rest/v1beta/projects.locations.templates'
update_mask: true
self_link: projects/{{project}}/locations/{{location}}/templates/{{template_id}}
create_url: projects/{{project}}/locations/{{location}}/templates?promptTemplateId={{template_id}}
create_url: projects/{{project}}/locations/{{location}}/templates?promptTemplateId={{template_id}}&regionalPropagationDisabled={{regional_propagation_disabled}}
update_url: projects/{{project}}/locations/{{location}}/templates/{{template_id}}?regionalPropagationDisabled={{regional_propagation_disabled}}
update_verb: PATCH
import_format:
- projects/{{project}}/locations/{{location}}/templates/{{template_id}}
delete_url: projects/{{project}}/locations/{{location}}/templates/{{template_id}}
delete_url: projects/{{project}}/locations/{{location}}/templates/{{template_id}}?regionalPropagationDisabled={{regional_propagation_disabled}}
autogen_async: false
autogen_status: UHJvbXB0VGVtcGxhdGU=
parameters:
Expand All @@ -38,6 +39,14 @@ parameters:
description: Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
immutable: true
url_param_only: true
- name: regional_propagation_disabled
type: Boolean
default_value: false
description: |-
For the `global` location only. If true, the write operation (create,
update, or delete) will apply to the global region only. Otherwise, the
operation will also propagate to all applicable regions.
url_param_only: true
properties:
- name: templateId
type: String
Expand Down Expand Up @@ -93,6 +102,11 @@ examples:
primary_resource_id: file
vars:
template_id: 'file-template'
- name: firebaseailogic_prompt_template_global_only
min_version: beta
primary_resource_id: global_only
vars:
template_id: 'global-only-template'
- name: firebaseailogic_prompt_template_basic
min_version: beta
primary_resource_id: basic
Expand Down
18 changes: 16 additions & 2 deletions mmv1/products/firebaseailogic/PromptTemplateLock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,14 @@ examples:
template_id: 'lock-template'
test_env_vars:
project_id: PROJECT_NAME
create_url: projects/{{project}}/locations/{{location}}/templates/{{template_id}}:modifyLock?locked=true
- name: firebaseailogic_prompt_template_lock_global_only
min_version: beta
primary_resource_id: global_only_lock
vars:
template_id: 'global-only-lock-template'
create_url: projects/{{project}}/locations/{{location}}/templates/{{template_id}}:modifyLock?locked=true&regionalPropagationDisabled={{regional_propagation_disabled}}
create_verb: POST
delete_url: projects/{{project}}/locations/{{location}}/templates/{{template_id}}:modifyLock?locked=false
delete_url: projects/{{project}}/locations/{{location}}/templates/{{template_id}}:modifyLock?locked=false&regionalPropagationDisabled={{regional_propagation_disabled}}
delete_verb: POST
custom_code:
# We read the PromptTemplate to verify it is locked
Expand All @@ -55,6 +60,15 @@ parameters:
url_param_only: true
required: true
immutable: true
- name: regional_propagation_disabled
Comment thread
tanzimfh marked this conversation as resolved.
type: Boolean
default_value: false
description: |-
For the `global` location only. If true, the modifyLock operation will
apply to the global region only. Otherwise, the operation will also
propagate to all applicable regions.
url_param_only: true
immutable: true
properties:
- name: name
type: String
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resource "google_firebase_ai_logic_prompt_template" "global_only" {
provider = google-beta
location = "global"
template_id = "{{index $.Vars "template_id"}}"
regional_propagation_disabled = true
template_string = file("test-fixtures/hello_world.prompt")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
resource "google_firebase_ai_logic_prompt_template" "global_only" {
provider = google-beta
location = "global"
template_id = "{{index $.Vars "template_id"}}"
template_string = <<EOF
---
model: googleai/gemini-1.5-flash
---
Hello World
EOF
}

resource "google_firebase_ai_logic_prompt_template_lock" "global_only_lock" {
provider = google-beta
location = google_firebase_ai_logic_prompt_template.global_only.location
template_id = google_firebase_ai_logic_prompt_template.global_only.template_id
regional_propagation_disabled = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestAccFirebaseAILogicPromptTemplate_firebaseailogicPromptTemplateUpdate(t
ResourceName: "google_firebase_ai_logic_prompt_template.updating",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"location"},
ImportStateVerifyIgnore: []string{"location", "regional_propagation_disabled"},
},
{
Config: testAccFirebaseAILogicPromptTemplate_firebaseailogicPromptTemplateUpdateExample(context, "Hello from Updated Version 2"),
Expand All @@ -67,7 +67,7 @@ func TestAccFirebaseAILogicPromptTemplate_firebaseailogicPromptTemplateUpdate(t
ResourceName: "google_firebase_ai_logic_prompt_template.updating",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"location"},
ImportStateVerifyIgnore: []string{"location", "regional_propagation_disabled"},
},
},
})
Expand Down Expand Up @@ -100,7 +100,7 @@ func TestAccFirebaseAILogicPromptTemplate_firebaseailogicPromptTemplateComplexUp
ResourceName: "google_firebase_ai_logic_prompt_template.complex",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"location"},
ImportStateVerifyIgnore: []string{"location", "regional_propagation_disabled"},
},
{
Config: testAccFirebaseAILogicPromptTemplate_firebaseailogicPromptTemplateComplexUpdateExample(context, "Updated Name", "gemini-1.5-flash", "Hello V1"),
Expand All @@ -112,7 +112,7 @@ func TestAccFirebaseAILogicPromptTemplate_firebaseailogicPromptTemplateComplexUp
ResourceName: "google_firebase_ai_logic_prompt_template.complex",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"location"},
ImportStateVerifyIgnore: []string{"location", "regional_propagation_disabled"},
},
{
Config: testAccFirebaseAILogicPromptTemplate_firebaseailogicPromptTemplateComplexUpdateExample(context, "Final Name", "gemini-2.0-flash", "Hello V2"),
Expand All @@ -125,7 +125,7 @@ func TestAccFirebaseAILogicPromptTemplate_firebaseailogicPromptTemplateComplexUp
ResourceName: "google_firebase_ai_logic_prompt_template.complex",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"location"},
ImportStateVerifyIgnore: []string{"location", "regional_propagation_disabled"},
},
},
})
Expand Down Expand Up @@ -243,7 +243,7 @@ func TestAccFirebaseAILogicPromptTemplate_regional(t *testing.T) {
ResourceName: "google_firebase_ai_logic_prompt_template.regional",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"location"},
ImportStateVerifyIgnore: []string{"location", "regional_propagation_disabled"},
},
},
})
Expand Down
Loading