|
| 1 | +resource "google_dialogflow_cx_agent" "agent" { |
| 2 | + display_name = "dialogflowcx-agent-${local.name_suffix}" |
| 3 | + location = "global" |
| 4 | + default_language_code = "en" |
| 5 | + time_zone = "America/New_York" |
| 6 | + description = "Example description." |
| 7 | +} |
| 8 | + |
| 9 | +resource "google_storage_bucket" "bucket" { |
| 10 | + name = "dialogflowcx-bucket-${local.name_suffix}" |
| 11 | + location = "US" |
| 12 | + uniform_bucket_level_access = true |
| 13 | +} |
| 14 | + |
| 15 | +resource "google_dialogflow_cx_webhook" "my_webhook" { |
| 16 | + parent = google_dialogflow_cx_agent.agent.id |
| 17 | + display_name = "MyWebhook" |
| 18 | + generic_web_service { |
| 19 | + uri = "https://example.com" |
| 20 | + } |
| 21 | +} |
| 22 | + |
| 23 | +resource "google_dialogflow_cx_tool" "my_tool" { |
| 24 | + parent = google_dialogflow_cx_agent.agent.id |
| 25 | + display_name = "Example Tool" |
| 26 | + description = "Example Description" |
| 27 | +} |
| 28 | + |
| 29 | +resource "google_dialogflow_cx_generator" "my_generator" { |
| 30 | + parent = google_dialogflow_cx_agent.agent.id |
| 31 | + display_name = "TF Prompt generator" |
| 32 | + llm_model_settings { |
| 33 | + model = "gemini-2.0-flash-001" |
| 34 | + prompt_text = "Return me some great results" |
| 35 | + } |
| 36 | + prompt_text { |
| 37 | + text = "Send me great results in french" |
| 38 | + } |
| 39 | + model_parameter { |
| 40 | + temperature = 0.55 |
| 41 | + } |
| 42 | +} |
| 43 | + |
| 44 | +resource "google_dialogflow_cx_playbook" "my-playbook" { |
| 45 | + parent = google_dialogflow_cx_agent.agent.id |
| 46 | + display_name = "Playbook Example with Fulfillment" |
| 47 | + goal = "Example Goal" |
| 48 | + instruction { |
| 49 | + guidelines = "Example Guidelines" |
| 50 | + steps { |
| 51 | + text = "step 1" |
| 52 | + steps = jsonencode([ |
| 53 | + { |
| 54 | + "text": "step 1 1" |
| 55 | + }, |
| 56 | + { |
| 57 | + "text": "step 1 2", |
| 58 | + "steps": [ |
| 59 | + { |
| 60 | + "text": "step 1 2 1" |
| 61 | + }, |
| 62 | + { |
| 63 | + "text": "step 1 2 2" |
| 64 | + } |
| 65 | + ] |
| 66 | + }, |
| 67 | + { |
| 68 | + "text": "step 1 3" |
| 69 | + } |
| 70 | + ]) |
| 71 | + } |
| 72 | + steps { |
| 73 | + text = "step 2" |
| 74 | + } |
| 75 | + steps { |
| 76 | + text = "step 3" |
| 77 | + } |
| 78 | + } |
| 79 | + |
| 80 | + llm_model_settings { |
| 81 | + model = "gemini-2.0-flash-001" |
| 82 | + prompt_text = "Return me some great results" |
| 83 | + } |
| 84 | + |
| 85 | + referenced_tools = [google_dialogflow_cx_tool.my_tool.id] |
| 86 | +} |
0 commit comments