Skip to content
Merged
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
2 changes: 1 addition & 1 deletion alloydb-ai-nla/deploy_alloydb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ else
fi

# 2. Generate random password (for new clusters)
PASSWORD=$(openssl rand -base64 15 | tr -dc 'a-zA-Z0-0' | head -c 16)
PASSWORD=$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | head -c 16)

# 3. Handle Cluster Creation or Detection
echo "Checking if cluster $CLUSTER_NAME exists..."
Expand Down
2 changes: 1 addition & 1 deletion alloydb-ai-nla/sixrecipe_context1_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
}
}
]
}
}
5 changes: 2 additions & 3 deletions alloydb-ai-nla/sixrecipe_context1_2.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
"manifest": "A given city houses close to good schools, or are great for families with kids.",
"parameterized": {
"parameterized_intent": "$1 houses close to good schools.",
"parameterized_sql": "Riverside houses close to good schools, or are great for families with kids.",
"sql": "SELECT \"p\".\"address_street\", \"s\".\"school_name\", \"stp\".\"proximity_miles\" FROM \"real_estate\".\"properties\" AS \"p\" JOIN \"real_estate\".\"cities\" AS \"c\" ON \"p\".\"city_id\" = \"c\".\"city_id\" JOIN \"real_estate\".\"school_to_property\" AS \"stp\" ON \"p\".\"property_id\" = \"stp\".\"property_id\" JOIN \"real_estate\".\"schools\" AS \"s\" ON \"stp\".\"school_id\" = \"s\".\"school_id\" WHERE \"c\".\"city_name\" = $1 AND \"s\".\"school_ranking\" <= 5 AND \"stp\".\"proximity_miles\" <= 2 ORDER BY 0.8 * \"s\".\"school_ranking\" + 0.2 * \"stp\".\"proximity_miles\""
"parameterized_sql": "SELECT \"p\".\"address_street\", \"s\".\"school_name\", \"stp\".\"proximity_miles\" FROM \"real_estate\".\"properties\" AS \"p\" JOIN \"real_estate\".\"cities\" AS \"c\" ON \"p\".\"city_id\" = \"c\".\"city_id\" JOIN \"real_estate\".\"school_to_property\" AS \"stp\" ON \"p\".\"property_id\" = \"stp\".\"property_id\" JOIN \"real_estate\".\"schools\" AS \"s\" ON \"stp\".\"school_id\" = \"s\".\"school_id\" WHERE \"c\".\"city_name\" = $1 AND \"s\".\"school_ranking\" <= 5 AND \"stp\".\"proximity_miles\" <= 2 ORDER BY 0.8 * \"s\".\"school_ranking\" + 0.2 * \"stp\".\"proximity_miles\""
}
}
]
}
}
2 changes: 1 addition & 1 deletion alloydb-ai-nla/sixrecipe_context2_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
}
}
]
}
}
2 changes: 1 addition & 1 deletion alloydb-ai-nla/sixrecipe_context2_2.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
}
}
]
}
}
2 changes: 1 addition & 1 deletion alloydb-ai-nla/sixrecipe_context3_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@
"description": "Trigram match for brokerage name"
}
]
}
}
2 changes: 1 addition & 1 deletion alloydb-ai-nla/sixrecipe_context4_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@
"description": "Trigram match for brokerage name"
}
]
}
}
2 changes: 1 addition & 1 deletion alloydb-ai-nla/sixrecipe_context4_2.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@
"description": "Trigram match for brokerage name"
}
]
}
}
14 changes: 7 additions & 7 deletions alloydb-ai-nla/sixrecipe_context4_3.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
"templates": [
{
"nl_query": "Riverside houses close to good schools.",
"sql": "SELECT \"p\".\"address_street\", \"p\".\"address_postal_code\", \"s\".\"school_name\", \"stp\".\"proximity_miles\" FROM \"real_estate\".\"properties\" AS \"p\" JOIN \"real_estate\".\"cities\" AS \"c\" ON \"p\".\"city_id\" = \"c\".\"city_id\" JOIN \"real_estate\".\"school_to_property\" AS \"stp\" ON \"p\".\"property_id\" = \"stp\".\"property_id\" JOIN \"real_estate\".\"schools\" AS \"s\" ON \"stp\".\"school_id\" = \"s\".\"school_id\" WHERE \"c\".\"city_name\" = 'Riverside' AND \"s\".\"school_ranking\" <= 5 AND \"stp\".\"proximity_miles\" <= 2 ORDER BY real_estate.school_score(\"s\".\"school_ranking\", \"stp\".\"proximity_miles\")",
"sql": "SELECT \"p\".\"address_street\", \"p\".\"address_postal_code\", \"s\".\"school_name\", \"stp\".\"proximity_miles\" FROM \"real_estate\".\"properties\" AS \"p\" JOIN \"real_estate\".\"cities\" AS \"c\" ON \"p\".\"city_id\" = \"c\".\"city_id\" JOIN \"real_estate\".\"school_to_property\" AS \"stp\" ON \"p\".\"property_id\" = \"stp\".\"property_id\" JOIN \"real_estate\".\"schools\" AS \"s\" ON \"stp\".\"school_id\" = \"s\".\"school_id\" WHERE \"c\".\"city_name\" = 'Riverside' AND \"s\".\"school_ranking\" <= 5 AND \"stp\".\"proximity_miles\" <= 2 ORDER BY 0.8 * \"s\".\"school_ranking\" + 0.2 * \"stp\".\"proximity_miles\"",
"intent": "Riverside houses close to good schools.",
"manifest": "A given city houses close to good schools.",
"parameterized": {
"parameterized_intent": "$1 houses close to good schools.",
"parameterized_sql": "SELECT \"p\".\"address_street\", \"p\".\"address_postal_code\", \"s\".\"school_name\", \"stp\".\"proximity_miles\" FROM \"real_estate\".\"properties\" AS \"p\" JOIN \"real_estate\".\"cities\" AS \"c\" ON \"p\".\"city_id\" = \"c\".\"city_id\" JOIN \"real_estate\".\"school_to_property\" AS \"stp\" ON \"p\".\"property_id\" = \"stp\".\"property_id\" JOIN \"real_estate\".\"schools\" AS \"s\" ON \"stp\".\"school_id\" = \"s\".\"school_id\" WHERE \"c\".\"city_name\" = $1 AND \"s\".\"school_ranking\" <= 5 AND \"stp\".\"proximity_miles\" <= 2 ORDER BY real_estate.school_score(\"s\".\"school_ranking\", \"stp\".\"proximity_miles\")"
"parameterized_sql": "SELECT \"p\".\"address_street\", \"p\".\"address_postal_code\", \"s\".\"school_name\", \"stp\".\"proximity_miles\" FROM \"real_estate\".\"properties\" AS \"p\" JOIN \"real_estate\".\"cities\" AS \"c\" ON \"p\".\"city_id\" = \"c\".\"city_id\" JOIN \"real_estate\".\"school_to_property\" AS \"stp\" ON \"p\".\"property_id\" = \"stp\".\"property_id\" JOIN \"real_estate\".\"schools\" AS \"s\" ON \"stp\".\"school_id\" = \"s\".\"school_id\" WHERE \"c\".\"city_name\" = $1 AND \"s\".\"school_ranking\" <= 5 AND \"stp\".\"proximity_miles\" <= 2 ORDER BY 0.8 * \"s\".\"school_ranking\" + 0.2 * \"stp\".\"proximity_miles\""
}
},
{
Expand All @@ -41,12 +41,12 @@
}
},
{
"nl_query": "Recommend houses with upgraded kitchen appliences",
"nl_query": "Recommend houses with upgraded kitchen appliances",
"sql": "SELECT \"p\".\"property_id\", \"p\".\"address_street\" FROM \"real_estate\".\"properties\" AS \"p\" WHERE \"p\".listing_status = 'Active' AND \"p\".\"description\" IS NOT NULL ORDER BY google_ml.embedding('gemini-embedding-001', 'Upgraded kitchen appliances')::vector <=> \"p\".\"description_embedding\" LIMIT 200",
"intent": "Recommend houses with upgraded kitchen appliences",
"manifest": "Recommend houses with upgraded kitchen appliences",
"intent": "Recommend houses with upgraded kitchen appliances",
"manifest": "Recommend houses with upgraded kitchen appliances",
"parameterized": {
"parameterized_intent": "Recommend houses with upgraded kitchen appliences",
"parameterized_intent": "Recommend houses with upgraded kitchen appliances",
"parameterized_sql": "SELECT \"p\".\"property_id\", \"p\".\"address_street\" FROM \"real_estate\".\"properties\" AS \"p\" WHERE \"p\".listing_status = 'Active' AND \"p\".\"description\" IS NOT NULL ORDER BY google_ml.embedding('gemini-embedding-001', 'Upgraded kitchen appliances')::vector <=> \"p\".\"description_embedding\" LIMIT 200"
}
}
Expand All @@ -68,4 +68,4 @@
"description": "Trigram match for brokerage name"
}
]
}
}