bigquery-data-science 0.7.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. bigquery_data_science/__init__.py +58 -0
  2. bigquery_data_science/_skills/PLANS.md +76 -0
  3. bigquery_data_science/_skills/bigquery-ai/SKILL.md +66 -0
  4. bigquery_data_science/_skills/bigquery-ai/narrative/ai_agg.md +528 -0
  5. bigquery_data_science/_skills/bigquery-ai/narrative/ai_classify.md +450 -0
  6. bigquery_data_science/_skills/bigquery-ai/narrative/ai_count_tokens.md +180 -0
  7. bigquery_data_science/_skills/bigquery-ai/narrative/ai_detect_anomalies.md +322 -0
  8. bigquery_data_science/_skills/bigquery-ai/narrative/ai_embed.md +425 -0
  9. bigquery_data_science/_skills/bigquery-ai/narrative/ai_evaluate.md +368 -0
  10. bigquery_data_science/_skills/bigquery-ai/narrative/ai_forecast.md +437 -0
  11. bigquery_data_science/_skills/bigquery-ai/narrative/ai_generate.md +693 -0
  12. bigquery_data_science/_skills/bigquery-ai/narrative/ai_generate_bool.md +248 -0
  13. bigquery_data_science/_skills/bigquery-ai/narrative/ai_generate_double.md +254 -0
  14. bigquery_data_science/_skills/bigquery-ai/narrative/ai_generate_embedding.md +402 -0
  15. bigquery_data_science/_skills/bigquery-ai/narrative/ai_generate_int.md +252 -0
  16. bigquery_data_science/_skills/bigquery-ai/narrative/ai_generate_table.md +447 -0
  17. bigquery_data_science/_skills/bigquery-ai/narrative/ai_generate_text.md +356 -0
  18. bigquery_data_science/_skills/bigquery-ai/narrative/ai_if.md +373 -0
  19. bigquery_data_science/_skills/bigquery-ai/narrative/ai_key_drivers.md +331 -0
  20. bigquery_data_science/_skills/bigquery-ai/narrative/ai_parse_document.md +416 -0
  21. bigquery_data_science/_skills/bigquery-ai/narrative/ai_predict.md +559 -0
  22. bigquery_data_science/_skills/bigquery-ai/narrative/ai_score.md +310 -0
  23. bigquery_data_science/_skills/bigquery-ai/narrative/ai_search.md +465 -0
  24. bigquery_data_science/_skills/bigquery-ai/narrative/ai_similarity.md +371 -0
  25. bigquery_data_science/_skills/bigquery-ai/narrative/catalog_search.md +951 -0
  26. bigquery_data_science/_skills/bigquery-ai/narrative/content_analysis.md +284 -0
  27. bigquery_data_science/_skills/bigquery-ai/narrative/content_moderation.md +369 -0
  28. bigquery_data_science/_skills/bigquery-ai/narrative/data_enrichment.md +426 -0
  29. bigquery_data_science/_skills/bigquery-ai/narrative/document_intelligence.md +470 -0
  30. bigquery_data_science/_skills/bigquery-ai/narrative/document_rag.md +453 -0
  31. bigquery_data_science/_skills/bigquery-ai/narrative/image_deduplication.md +770 -0
  32. bigquery_data_science/_skills/bigquery-ai/narrative/log_analysis.md +668 -0
  33. bigquery_data_science/_skills/bigquery-ai/narrative/metric_diagnostics.md +568 -0
  34. bigquery_data_science/_skills/bigquery-ai/narrative/ml_annotate_image.md +680 -0
  35. bigquery_data_science/_skills/bigquery-ai/narrative/ml_generate_embedding.md +217 -0
  36. bigquery_data_science/_skills/bigquery-ai/narrative/ml_generate_text.md +223 -0
  37. bigquery_data_science/_skills/bigquery-ai/narrative/ml_process_document.md +392 -0
  38. bigquery_data_science/_skills/bigquery-ai/narrative/ml_transcribe.md +815 -0
  39. bigquery_data_science/_skills/bigquery-ai/narrative/ml_translate.md +600 -0
  40. bigquery_data_science/_skills/bigquery-ai/narrative/ml_understand_text.md +673 -0
  41. bigquery_data_science/_skills/bigquery-ai/narrative/multimodal_analysis.md +266 -0
  42. bigquery_data_science/_skills/bigquery-ai/narrative/rag_pipeline.md +593 -0
  43. bigquery_data_science/_skills/bigquery-ai/narrative/semantic_search.md +510 -0
  44. bigquery_data_science/_skills/bigquery-ai/narrative/tabular_prediction.md +485 -0
  45. bigquery_data_science/_skills/bigquery-ai/narrative/time_series_intelligence.md +489 -0
  46. bigquery_data_science/_skills/bigquery-ai/narrative/vector_search.md +672 -0
  47. bigquery_data_science/_skills/bigquery-ai/reference/augmented-analytics.md +77 -0
  48. bigquery_data_science/_skills/bigquery-ai/reference/cloud-ai-service-models.md +88 -0
  49. bigquery_data_science/_skills/bigquery-ai/reference/document-processing.md +95 -0
  50. bigquery_data_science/_skills/bigquery-ai/reference/embeddings-and-search.md +166 -0
  51. bigquery_data_science/_skills/bigquery-ai/reference/general-purpose-generation.md +87 -0
  52. bigquery_data_science/_skills/bigquery-ai/reference/managed-functions.md +72 -0
  53. bigquery_data_science/_skills/bigquery-ai/reference/predictive-ai.md +113 -0
  54. bigquery_data_science/_skills/bigquery-ai/reference/workflows.md +56 -0
  55. bigquery_data_science/_skills/bigquery-ai/skill.manifest.json +109 -0
  56. bigquery_data_science/_skills/bigquery-ai/syntax/INDEX.md +71 -0
  57. bigquery_data_science/_skills/bigquery-ai/syntax/aiagg.md +67 -0
  58. bigquery_data_science/_skills/bigquery-ai/syntax/aicausal_effect-covered-in-bigquery-ml.md +17 -0
  59. bigquery_data_science/_skills/bigquery-ai/syntax/aiclassify.md +72 -0
  60. bigquery_data_science/_skills/bigquery-ai/syntax/aicount_tokens.md +53 -0
  61. bigquery_data_science/_skills/bigquery-ai/syntax/aidetect_anomalies.md +63 -0
  62. bigquery_data_science/_skills/bigquery-ai/syntax/aiembed.md +85 -0
  63. bigquery_data_science/_skills/bigquery-ai/syntax/aievaluate.md +114 -0
  64. bigquery_data_science/_skills/bigquery-ai/syntax/aiforecast.md +123 -0
  65. bigquery_data_science/_skills/bigquery-ai/syntax/aigenerate.md +69 -0
  66. bigquery_data_science/_skills/bigquery-ai/syntax/aigenerate_bool.md +53 -0
  67. bigquery_data_science/_skills/bigquery-ai/syntax/aigenerate_double.md +45 -0
  68. bigquery_data_science/_skills/bigquery-ai/syntax/aigenerate_embedding.md +108 -0
  69. bigquery_data_science/_skills/bigquery-ai/syntax/aigenerate_int.md +45 -0
  70. bigquery_data_science/_skills/bigquery-ai/syntax/aigenerate_table.md +64 -0
  71. bigquery_data_science/_skills/bigquery-ai/syntax/aigenerate_text.md +167 -0
  72. bigquery_data_science/_skills/bigquery-ai/syntax/aiif.md +56 -0
  73. bigquery_data_science/_skills/bigquery-ai/syntax/aikey_drivers.md +76 -0
  74. bigquery_data_science/_skills/bigquery-ai/syntax/aiparse_document.md +91 -0
  75. bigquery_data_science/_skills/bigquery-ai/syntax/aipredict.md +74 -0
  76. bigquery_data_science/_skills/bigquery-ai/syntax/aiscore.md +52 -0
  77. bigquery_data_science/_skills/bigquery-ai/syntax/aisearch.md +66 -0
  78. bigquery_data_science/_skills/bigquery-ai/syntax/aisimilarity.md +79 -0
  79. bigquery_data_science/_skills/bigquery-ai/syntax/choosing-between-these-and-the-ai-functions.md +11 -0
  80. bigquery_data_science/_skills/bigquery-ai/syntax/hybrid-search-capability.md +165 -0
  81. bigquery_data_science/_skills/bigquery-ai/syntax/mlannotate_image.md +24 -0
  82. bigquery_data_science/_skills/bigquery-ai/syntax/mlgenerate_embedding.md +34 -0
  83. bigquery_data_science/_skills/bigquery-ai/syntax/mlgenerate_text.md +65 -0
  84. bigquery_data_science/_skills/bigquery-ai/syntax/mlprocess_document.md +125 -0
  85. bigquery_data_science/_skills/bigquery-ai/syntax/mltranscribe.md +26 -0
  86. bigquery_data_science/_skills/bigquery-ai/syntax/mltranslate.md +27 -0
  87. bigquery_data_science/_skills/bigquery-ai/syntax/mlunderstand_text.md +32 -0
  88. bigquery_data_science/_skills/bigquery-ai/syntax/multimodal-input-patterns-by-function.md +128 -0
  89. bigquery_data_science/_skills/bigquery-ai/syntax/object-tables.md +109 -0
  90. bigquery_data_science/_skills/bigquery-ai/syntax/objectref-and-objectrefruntime-schema-reference.md +50 -0
  91. bigquery_data_science/_skills/bigquery-ai/syntax/objfetch_metadata.md +49 -0
  92. bigquery_data_science/_skills/bigquery-ai/syntax/objget_access_url.md +66 -0
  93. bigquery_data_science/_skills/bigquery-ai/syntax/objget_read_url.md +40 -0
  94. bigquery_data_science/_skills/bigquery-ai/syntax/objlist.md +34 -0
  95. bigquery_data_science/_skills/bigquery-ai/syntax/objmake_ref.md +58 -0
  96. bigquery_data_science/_skills/bigquery-ai/syntax/per-row-failures-and-the-retry-pattern.md +19 -0
  97. bigquery_data_science/_skills/bigquery-ai/syntax/setup-apis-connection-roles.md +39 -0
  98. bigquery_data_science/_skills/bigquery-ai/syntax/two-input-shapes.md +22 -0
  99. bigquery_data_science/_skills/bigquery-ai/syntax/vector_search.md +78 -0
  100. bigquery_data_science/_skills/bigquery-ai/syntax/what-the-five-have-in-common.md +27 -0
  101. bigquery_data_science/_skills/bigquery-data-science/SKILL.md +69 -0
  102. bigquery_data_science/_skills/bigquery-data-science/reference/namespace-matrix.md +112 -0
  103. bigquery_data_science/_skills/bigquery-data-science/skill.manifest.json +13 -0
  104. bigquery_data_science/_skills/bigquery-ml/SKILL.md +70 -0
  105. bigquery_data_science/_skills/bigquery-ml/narrative/airflow_with_kfp.md +379 -0
  106. bigquery_data_science/_skills/bigquery-ml/narrative/anomaly_fraud_detection.md +195 -0
  107. bigquery_data_science/_skills/bigquery-ml/narrative/arima_plus.md +635 -0
  108. bigquery_data_science/_skills/bigquery-ml/narrative/arima_plus_xreg.md +453 -0
  109. bigquery_data_science/_skills/bigquery-ml/narrative/autoencoder.md +470 -0
  110. bigquery_data_science/_skills/bigquery-ml/narrative/automl_classifier.md +291 -0
  111. bigquery_data_science/_skills/bigquery-ml/narrative/automl_regressor.md +274 -0
  112. bigquery_data_science/_skills/bigquery-ml/narrative/boosted_tree_classifier.md +449 -0
  113. bigquery_data_science/_skills/bigquery-ml/narrative/boosted_tree_regressor.md +400 -0
  114. bigquery_data_science/_skills/bigquery-ml/narrative/bucketizing.md +201 -0
  115. bigquery_data_science/_skills/bigquery-ml/narrative/causal_effect.md +773 -0
  116. bigquery_data_science/_skills/bigquery-ml/narrative/churn_retention.md +271 -0
  117. bigquery_data_science/_skills/bigquery-ml/narrative/cloud_workflows.md +370 -0
  118. bigquery_data_science/_skills/bigquery-ml/narrative/composer_airflow.md +475 -0
  119. bigquery_data_science/_skills/bigquery-ml/narrative/contribution_analysis.md +346 -0
  120. bigquery_data_science/_skills/bigquery-ml/narrative/cross_validation.md +185 -0
  121. bigquery_data_science/_skills/bigquery-ml/narrative/customer_segmentation.md +233 -0
  122. bigquery_data_science/_skills/bigquery-ml/narrative/dataform.md +372 -0
  123. bigquery_data_science/_skills/bigquery-ml/narrative/dbt.md +283 -0
  124. bigquery_data_science/_skills/bigquery-ml/narrative/difference_in_differences.md +280 -0
  125. bigquery_data_science/_skills/bigquery-ml/narrative/distance.md +195 -0
  126. bigquery_data_science/_skills/bigquery-ml/narrative/dnn_classifier.md +326 -0
  127. bigquery_data_science/_skills/bigquery-ml/narrative/dnn_regressor.md +308 -0
  128. bigquery_data_science/_skills/bigquery-ml/narrative/embeddings_classification.md +426 -0
  129. bigquery_data_science/_skills/bigquery-ml/narrative/encoding.md +238 -0
  130. bigquery_data_science/_skills/bigquery-ml/narrative/ensembling.md +278 -0
  131. bigquery_data_science/_skills/bigquery-ml/narrative/evaluation.md +445 -0
  132. bigquery_data_science/_skills/bigquery-ml/narrative/exploration.md +779 -0
  133. bigquery_data_science/_skills/bigquery-ml/narrative/export.md +321 -0
  134. bigquery_data_science/_skills/bigquery-ml/narrative/feature_engineering.md +280 -0
  135. bigquery_data_science/_skills/bigquery-ml/narrative/feature_store.md +652 -0
  136. bigquery_data_science/_skills/bigquery-ml/narrative/feature_store_workflow.md +426 -0
  137. bigquery_data_science/_skills/bigquery-ml/narrative/ga4_churn_prediction.md +285 -0
  138. bigquery_data_science/_skills/bigquery-ml/narrative/hierarchical_forecasting.md +441 -0
  139. bigquery_data_science/_skills/bigquery-ml/narrative/image.md +791 -0
  140. bigquery_data_science/_skills/bigquery-ml/narrative/imported.md +426 -0
  141. bigquery_data_science/_skills/bigquery-ml/narrative/kmeans.md +348 -0
  142. bigquery_data_science/_skills/bigquery-ml/narrative/linear_regression.md +372 -0
  143. bigquery_data_science/_skills/bigquery-ml/narrative/logistic_regression.md +390 -0
  144. bigquery_data_science/_skills/bigquery-ml/narrative/matrix_factorization.md +404 -0
  145. bigquery_data_science/_skills/bigquery-ml/narrative/model_monitoring.md +609 -0
  146. bigquery_data_science/_skills/bigquery-ml/narrative/pca.md +357 -0
  147. bigquery_data_science/_skills/bigquery-ml/narrative/price_elasticity_dml.md +286 -0
  148. bigquery_data_science/_skills/bigquery-ml/narrative/propensity_score_matching.md +350 -0
  149. bigquery_data_science/_skills/bigquery-ml/narrative/random_forest_classifier.md +445 -0
  150. bigquery_data_science/_skills/bigquery-ml/narrative/random_forest_regressor.md +409 -0
  151. bigquery_data_science/_skills/bigquery-ml/narrative/recommendation.md +281 -0
  152. bigquery_data_science/_skills/bigquery-ml/narrative/regression_based_forecasting.md +491 -0
  153. bigquery_data_science/_skills/bigquery-ml/narrative/remote.md +428 -0
  154. bigquery_data_science/_skills/bigquery-ml/narrative/scalers.md +325 -0
  155. bigquery_data_science/_skills/bigquery-ml/narrative/scheduled_queries.md +284 -0
  156. bigquery_data_science/_skills/bigquery-ml/narrative/sql_scripting.md +243 -0
  157. bigquery_data_science/_skills/bigquery-ml/narrative/survival_analysis.md +363 -0
  158. bigquery_data_science/_skills/bigquery-ml/narrative/synthetic_control.md +221 -0
  159. bigquery_data_science/_skills/bigquery-ml/narrative/text.md +215 -0
  160. bigquery_data_science/_skills/bigquery-ml/narrative/time_series.md +669 -0
  161. bigquery_data_science/_skills/bigquery-ml/narrative/transform_only.md +273 -0
  162. bigquery_data_science/_skills/bigquery-ml/narrative/uplift_cate.md +241 -0
  163. bigquery_data_science/_skills/bigquery-ml/narrative/vertex_kfp.md +360 -0
  164. bigquery_data_science/_skills/bigquery-ml/narrative/wide_and_deep_classifier.md +316 -0
  165. bigquery_data_science/_skills/bigquery-ml/narrative/wide_and_deep_regressor.md +298 -0
  166. bigquery_data_science/_skills/bigquery-ml/reference/classification.md +80 -0
  167. bigquery_data_science/_skills/bigquery-ml/reference/model-management.md +90 -0
  168. bigquery_data_science/_skills/bigquery-ml/reference/preprocessing-functions.md +234 -0
  169. bigquery_data_science/_skills/bigquery-ml/reference/regression.md +79 -0
  170. bigquery_data_science/_skills/bigquery-ml/reference/unsupervised-and-specialized.md +101 -0
  171. bigquery_data_science/_skills/bigquery-ml/reference/workflows-and-pipelines.md +111 -0
  172. bigquery_data_science/_skills/bigquery-ml/skill.manifest.json +177 -0
  173. bigquery_data_science/_skills/bigquery-ml/syntax/1-model_type-catalog.md +28 -0
  174. bigquery_data_science/_skills/bigquery-ml/syntax/2-task-mlevaluate-metric-columns.md +26 -0
  175. bigquery_data_science/_skills/bigquery-ml/syntax/3-capability-matrix-per-model-type.md +21 -0
  176. bigquery_data_science/_skills/bigquery-ml/syntax/4-explainability-weights-functions.md +14 -0
  177. bigquery_data_science/_skills/bigquery-ml/syntax/5-connection-matrix.md +11 -0
  178. bigquery_data_science/_skills/bigquery-ml/syntax/6-which-model-free-function-no-create-model-no-connection.md +15 -0
  179. bigquery_data_science/_skills/bigquery-ml/syntax/7-point-in-time-feature-retrieval-which-of-the-two.md +11 -0
  180. bigquery_data_science/_skills/bigquery-ml/syntax/INDEX.md +111 -0
  181. bigquery_data_science/_skills/bigquery-ml/syntax/aicausal_effect.md +85 -0
  182. bigquery_data_science/_skills/bigquery-ml/syntax/arima_plus-forecasting-lifecycle-functions.md +14 -0
  183. bigquery_data_science/_skills/bigquery-ml/syntax/arima_plus-univariate-time-series-forecasting.md +132 -0
  184. bigquery_data_science/_skills/bigquery-ml/syntax/arima_plus_xreg-multivariate-time-series-with-external-regressors.md +103 -0
  185. bigquery_data_science/_skills/bigquery-ml/syntax/autoencoder.md +102 -0
  186. bigquery_data_science/_skills/bigquery-ml/syntax/automl_classifier-automl_regressor.md +88 -0
  187. bigquery_data_science/_skills/bigquery-ml/syntax/boosted_tree_classifier-boosted_tree_regressor.md +117 -0
  188. bigquery_data_science/_skills/bigquery-ml/syntax/contribution_analysis.md +113 -0
  189. bigquery_data_science/_skills/bigquery-ml/syntax/dnn_classifier-dnn_regressor.md +107 -0
  190. bigquery_data_science/_skills/bigquery-ml/syntax/dnn_linear_combined_classifier-dnn_linear_combined_regressor-wide-and-deep.md +98 -0
  191. bigquery_data_science/_skills/bigquery-ml/syntax/explainability-functions-mlexplain_predict-mlglobal_explain-mlfeature_importance.md +7 -0
  192. bigquery_data_science/_skills/bigquery-ml/syntax/exploratory-data-analysis-mldescribe_data-mlcorrelation.md +11 -0
  193. bigquery_data_science/_skills/bigquery-ml/syntax/export-model.md +92 -0
  194. bigquery_data_science/_skills/bigquery-ml/syntax/feature-engineering-standalone-preprocessing-functions.md +13 -0
  195. bigquery_data_science/_skills/bigquery-ml/syntax/image-preprocessing-functions-mldecode_image-mlresize_image-mlconvert_image_type-mlconvert_color_space.md +63 -0
  196. bigquery_data_science/_skills/bigquery-ml/syntax/imported-models-tensorflow-tensorflow_lite-onnx-xgboost.md +36 -0
  197. bigquery_data_science/_skills/bigquery-ml/syntax/kmeans.md +87 -0
  198. bigquery_data_science/_skills/bigquery-ml/syntax/linear_reg-logistic_reg-generalized-linear-models.md +101 -0
  199. bigquery_data_science/_skills/bigquery-ml/syntax/matrix_factorization.md +162 -0
  200. bigquery_data_science/_skills/bigquery-ml/syntax/mladvanced_weights.md +76 -0
  201. bigquery_data_science/_skills/bigquery-ml/syntax/mlarima_coefficients.md +30 -0
  202. bigquery_data_science/_skills/bigquery-ml/syntax/mlarima_evaluate.md +49 -0
  203. bigquery_data_science/_skills/bigquery-ml/syntax/mlbag_of_words.md +47 -0
  204. bigquery_data_science/_skills/bigquery-ml/syntax/mlbucketize.md +47 -0
  205. bigquery_data_science/_skills/bigquery-ml/syntax/mlcentroids.md +46 -0
  206. bigquery_data_science/_skills/bigquery-ml/syntax/mlconfusion_matrix.md +56 -0
  207. bigquery_data_science/_skills/bigquery-ml/syntax/mlconvert_color_space.md +53 -0
  208. bigquery_data_science/_skills/bigquery-ml/syntax/mlconvert_image_type.md +39 -0
  209. bigquery_data_science/_skills/bigquery-ml/syntax/mlcorrelation.md +78 -0
  210. bigquery_data_science/_skills/bigquery-ml/syntax/mldecode_image.md +44 -0
  211. bigquery_data_science/_skills/bigquery-ml/syntax/mldescribe_data.md +74 -0
  212. bigquery_data_science/_skills/bigquery-ml/syntax/mldetect_anomalies.md +86 -0
  213. bigquery_data_science/_skills/bigquery-ml/syntax/mldistance.md +48 -0
  214. bigquery_data_science/_skills/bigquery-ml/syntax/mlentity_features_at_time.md +56 -0
  215. bigquery_data_science/_skills/bigquery-ml/syntax/mlevaluate.md +72 -0
  216. bigquery_data_science/_skills/bigquery-ml/syntax/mlexplain_forecast.md +50 -0
  217. bigquery_data_science/_skills/bigquery-ml/syntax/mlexplain_predict.md +66 -0
  218. bigquery_data_science/_skills/bigquery-ml/syntax/mlfeature_cross.md +46 -0
  219. bigquery_data_science/_skills/bigquery-ml/syntax/mlfeature_importance.md +47 -0
  220. bigquery_data_science/_skills/bigquery-ml/syntax/mlfeature_info.md +50 -0
  221. bigquery_data_science/_skills/bigquery-ml/syntax/mlfeatures_at_time.md +51 -0
  222. bigquery_data_science/_skills/bigquery-ml/syntax/mlforecast.md +76 -0
  223. bigquery_data_science/_skills/bigquery-ml/syntax/mlgenerate_embedding-from-a-bqml-pca-autoencoder-matrix_factorization-model.md +64 -0
  224. bigquery_data_science/_skills/bigquery-ml/syntax/mlglobal_explain.md +63 -0
  225. bigquery_data_science/_skills/bigquery-ml/syntax/mlhash_bucketize.md +47 -0
  226. bigquery_data_science/_skills/bigquery-ml/syntax/mlholiday_info.md +46 -0
  227. bigquery_data_science/_skills/bigquery-ml/syntax/mlimputer.md +46 -0
  228. bigquery_data_science/_skills/bigquery-ml/syntax/mllp_norm.md +47 -0
  229. bigquery_data_science/_skills/bigquery-ml/syntax/mlmetrics.md +80 -0
  230. bigquery_data_science/_skills/bigquery-ml/syntax/mlngrams.md +37 -0
  231. bigquery_data_science/_skills/bigquery-ml/syntax/mlone_hot_encoder-mlmulti_hot_encoder-mllabel_encoder.md +67 -0
  232. bigquery_data_science/_skills/bigquery-ml/syntax/mlpolynomial_expand.md +47 -0
  233. bigquery_data_science/_skills/bigquery-ml/syntax/mlpredict.md +67 -0
  234. bigquery_data_science/_skills/bigquery-ml/syntax/mlprincipal_component_info.md +42 -0
  235. bigquery_data_science/_skills/bigquery-ml/syntax/mlprincipal_components.md +40 -0
  236. bigquery_data_science/_skills/bigquery-ml/syntax/mlquantile_bucketize.md +43 -0
  237. bigquery_data_science/_skills/bigquery-ml/syntax/mlrecommend.md +60 -0
  238. bigquery_data_science/_skills/bigquery-ml/syntax/mlreconstruction_loss.md +48 -0
  239. bigquery_data_science/_skills/bigquery-ml/syntax/mlresize_image.md +45 -0
  240. bigquery_data_science/_skills/bigquery-ml/syntax/mlroc_curve.md +63 -0
  241. bigquery_data_science/_skills/bigquery-ml/syntax/mltf_idf.md +37 -0
  242. bigquery_data_science/_skills/bigquery-ml/syntax/mltfdv_describe.md +34 -0
  243. bigquery_data_science/_skills/bigquery-ml/syntax/mltfdv_validate.md +48 -0
  244. bigquery_data_science/_skills/bigquery-ml/syntax/mltraining_info.md +78 -0
  245. bigquery_data_science/_skills/bigquery-ml/syntax/mltransform-applying-a-saved-transform.md +52 -0
  246. bigquery_data_science/_skills/bigquery-ml/syntax/mltranspose-not-a-function-pointer.md +32 -0
  247. bigquery_data_science/_skills/bigquery-ml/syntax/mltrial_info.md +60 -0
  248. bigquery_data_science/_skills/bigquery-ml/syntax/mlvalidate_data_drift.md +99 -0
  249. bigquery_data_science/_skills/bigquery-ml/syntax/mlvalidate_data_skew.md +50 -0
  250. bigquery_data_science/_skills/bigquery-ml/syntax/mlweights.md +84 -0
  251. bigquery_data_science/_skills/bigquery-ml/syntax/model-free-time-series-decomposition-mltrend-mlseasonality-mldetect_change_points.md +100 -0
  252. bigquery_data_science/_skills/bigquery-ml/syntax/model-introspection-mlfeature_info-mltraining_info-mltrial_info.md +7 -0
  253. bigquery_data_science/_skills/bigquery-ml/syntax/model-monitoring-data-validation.md +23 -0
  254. bigquery_data_science/_skills/bigquery-ml/syntax/numerical-scalers-mlstandard_scaler-mlmin_max_scaler-mlmax_abs_scaler-mlrobust_scaler-mlnormalizer.md +77 -0
  255. bigquery_data_science/_skills/bigquery-ml/syntax/onnx.md +55 -0
  256. bigquery_data_science/_skills/bigquery-ml/syntax/pca.md +91 -0
  257. bigquery_data_science/_skills/bigquery-ml/syntax/point-in-time-feature-retrieval-mlfeatures_at_time-mlentity_features_at_time.md +25 -0
  258. bigquery_data_science/_skills/bigquery-ml/syntax/quick-comparison.md +14 -0
  259. bigquery_data_science/_skills/bigquery-ml/syntax/random_forest_classifier-random_forest_regressor.md +123 -0
  260. bigquery_data_science/_skills/bigquery-ml/syntax/remote-remote-model-over-a-vertex-ai-endpoint-the-mechanism.md +87 -0
  261. bigquery_data_science/_skills/bigquery-ml/syntax/tensorflow.md +48 -0
  262. bigquery_data_science/_skills/bigquery-ml/syntax/tensorflow_lite.md +29 -0
  263. bigquery_data_science/_skills/bigquery-ml/syntax/text-preprocessing-functions-mlngrams-mltf_idf-mlbag_of_words.md +18 -0
  264. bigquery_data_science/_skills/bigquery-ml/syntax/timesfm-built-in-foundation-forecaster-see-bigquery-ai.md +28 -0
  265. bigquery_data_science/_skills/bigquery-ml/syntax/transform_only.md +91 -0
  266. bigquery_data_science/_skills/bigquery-ml/syntax/xgboost.md +72 -0
  267. bigquery_data_science/_skills/pinned-models.json +28 -0
  268. bigquery_data_science/catalog.py +1107 -0
  269. bigquery_data_science/cli.py +786 -0
  270. bigquery_data_science/installer.py +282 -0
  271. bigquery_data_science/mcp_server.py +317 -0
  272. bigquery_data_science/tooling/__init__.py +15 -0
  273. bigquery_data_science/tooling/convert_notebook.py +176 -0
  274. bigquery_data_science/tooling/link_policy.py +247 -0
  275. bigquery_data_science/tooling/manifest.py +152 -0
  276. bigquery_data_science/tooling/markdown_anchors.py +84 -0
  277. bigquery_data_science/tooling/narrative_drift.py +163 -0
  278. bigquery_data_science/tooling/pinned_models.py +216 -0
  279. bigquery_data_science/tooling/reference_structure.py +85 -0
  280. bigquery_data_science/tooling/sync_syntax.py +407 -0
  281. bigquery_data_science/tooling/validate.py +208 -0
  282. bigquery_data_science-0.7.0.dist-info/METADATA +306 -0
  283. bigquery_data_science-0.7.0.dist-info/RECORD +286 -0
  284. bigquery_data_science-0.7.0.dist-info/WHEEL +4 -0
  285. bigquery_data_science-0.7.0.dist-info/entry_points.txt +5 -0
  286. bigquery_data_science-0.7.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,125 @@
1
+ # `ML.PROCESS_DOCUMENT`
2
+
3
+ > **Source:** [`bigquery-ai/reference/document-processing.md#mlprocess_document`](https://github.com/statmike/bigquery-data-science/blob/main/bigquery-ai/reference/document-processing.md#mlprocess_document)
4
+
5
+ - **Description:** Table-valued function that processes unstructured documents from an object table using the Document AI API. Sends documents stored in Cloud Storage (referenced via a BigQuery object table) to a Document AI processor and returns structured extraction results (entities, key-value pairs, parsed content) directly as BigQuery columns.
6
+ - **Use cases:** Invoice parsing, expense/receipt extraction, form key-value extraction, OCR text extraction, document layout analysis and chunking (for RAG pipelines), bank statement parsing, W2/tax form parsing, utility bill parsing, pay slip parsing, US passport and driver license parsing, identity document proofing, custom document classification, custom document splitting, document summarization.
7
+ - [documentation](https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-process-document)
8
+ - **Type:** Table-valued function (returns a table)
9
+
10
+ **Syntax:**
11
+ ```sql
12
+ SELECT *
13
+ FROM ML.PROCESS_DOCUMENT(
14
+ MODEL `PROJECT_ID.DATASET.MODEL`,
15
+ { TABLE `PROJECT_ID.DATASET.OBJECT_TABLE` | (QUERY_STATEMENT) }
16
+ [, PROCESS_OPTIONS => (JSON 'PROCESS_OPTIONS')]
17
+ );
18
+ ```
19
+
20
+ **Model creation (prerequisite):**
21
+ ```sql
22
+ CREATE OR REPLACE MODEL `PROJECT_ID.DATASET_ID.MODEL_NAME`
23
+ REMOTE WITH CONNECTION {DEFAULT | `PROJECT_ID.REGION.CONNECTION_ID`}
24
+ OPTIONS (
25
+ REMOTE_SERVICE_TYPE = 'CLOUD_AI_DOCUMENT_V1',
26
+ DOCUMENT_PROCESSOR = 'PROCESSOR_ID'
27
+ );
28
+ ```
29
+
30
+ **Inputs:**
31
+
32
+ | Parameter | Type | Required | Default | Description |
33
+ |-----------|------|----------|---------|-------------|
34
+ | `MODEL` | Model reference | Required | -- | Fully-qualified name of a remote model with `REMOTE_SERVICE_TYPE = 'CLOUD_AI_DOCUMENT_V1'`. |
35
+ | `TABLE` / `(QUERY_STATEMENT)` | Table or subquery | Required | -- | Object table reference or a `SELECT` subquery over the object table. Subquery cannot use `JOIN` or rename columns with aliases. Must include `uri` and `content_type` columns. |
36
+ | `PROCESS_OPTIONS` | JSON (named parameter) | Optional | -- | A `ProcessOptions` resource in JSON format. Configures processing options like OCR config, layout parser chunking, page selection. |
37
+
38
+ **PROCESS_OPTIONS details:**
39
+
40
+ | Field | Applicable To | Description |
41
+ |-------|---------------|-------------|
42
+ | `ocrConfig.hints.languageHints[]` | OCR, Form Parser | BCP-47 language codes. Auto-detection if not specified. |
43
+ | `ocrConfig.enableNativePdfParsing` | OCR, Form Parser | Better extraction for PDFs with existing text. |
44
+ | `ocrConfig.enableImageQualityScores` | OCR, Form Parser | Returns quality scores. Adds latency. |
45
+ | `ocrConfig.premiumFeatures.enableSelectionMarkDetection` | OCR 2.0+ | Enable checkbox detection. |
46
+ | `ocrConfig.premiumFeatures.computeStyleInfo` | OCR, Form Parser | Enable font identification and style info. |
47
+ | `ocrConfig.premiumFeatures.enableMathOcr` | OCR, Form Parser | Extract LaTeX math formulas. |
48
+ | `layoutConfig.chunkingConfig.chunkSize` | Layout Parser | Chunk size for splitting documents. |
49
+ | `layoutConfig.chunkingConfig.includeAncestorHeadings` | Layout Parser | Include ancestor headings when splitting. |
50
+ | `layoutConfig.returnImages` | Layout Parser | Include images in response. |
51
+ | `layoutConfig.returnBoundingBoxes` | Layout Parser | Include bounding boxes. |
52
+ | `individualPageSelector.pages[]` | All | 1-indexed list of specific pages to process. |
53
+ | `fromStart` | All | Only process this many pages from the start. |
54
+ | `fromEnd` | All | Only process this many pages from the end. |
55
+
56
+ Note: `individualPageSelector`, `fromStart`, and `fromEnd` are a union field — only one can be specified. Setting `ocrConfig` on a non-OCR processor or `layoutConfig` on a non-Layout Parser processor returns an error.
57
+
58
+ **Outputs:**
59
+
60
+ | Column | Type | Description |
61
+ |--------|------|-------------|
62
+ | `ml_process_document_result` | JSON | Entities returned by the Document AI API (confidence scores, mention text, page anchors, bounding polygons, properties). |
63
+ | `ml_process_document_status` | STRING | API response status. Empty if successful. Contains error messages (e.g., `RESOURCE EXHAUSTED`) if processing failed. |
64
+ | *(processor-specific fields)* | *(varies)* | Fields specific to the processor (e.g., invoice parser returns `invoice_type`, `currency`, `total_amount`). Visible in the model's Schema tab under Labels. |
65
+ | *(object table columns)* | *(varies)* | All columns from the input object table or query are passed through (e.g., `uri`, `content_type`). |
66
+
67
+ **Supported Document AI processors:**
68
+
69
+ | Category | Processor | Type ID |
70
+ |----------|-----------|---------|
71
+ | Digitize Text | Enterprise Document OCR | `OCR_PROCESSOR` |
72
+ | Extract (General) | Custom Extractor | `CUSTOM_EXTRACTION_PROCESSOR` |
73
+ | Extract (General) | Form Parser | `FORM_PARSER_PROCESSOR` |
74
+ | Extract (General) | Layout Parser | `LAYOUT_PARSER_PROCESSOR` |
75
+ | Extract (Pretrained) | Bank Statement Parser | `BANK_STATEMENT_PROCESSOR` |
76
+ | Extract (Pretrained) | W2 Parser | `FORM_W2_PROCESSOR` |
77
+ | Extract (Pretrained) | US Passport Parser | `US_PASSPORT_PROCESSOR` |
78
+ | Extract (Pretrained) | Utility Parser | `UTILITY_PROCESSOR` |
79
+ | Extract (Pretrained) | Identity Document Proofing | `ID_PROOFING_PROCESSOR` |
80
+ | Extract (Pretrained) | Pay Slip Parser | `PAYSTUB_PROCESSOR` |
81
+ | Extract (Pretrained) | US Driver License Parser | `US_DRIVER_LICENSE_PROCESSOR` |
82
+ | Extract (Pretrained) | Expense Parser | `EXPENSE_PROCESSOR` |
83
+ | Extract (Pretrained) | Invoice Parser | `INVOICE_PROCESSOR` |
84
+ | Classify | Custom Classifier | `CUSTOM_CLASSIFICATION_PROCESSOR` |
85
+ | Split | Custom Splitter | `CUSTOM_SPLITTING_PROCESSOR` |
86
+ | Summarize | Summarizer | `SUMMARY_PROCESSOR` |
87
+
88
+ **Supported file types:**
89
+
90
+ | Format | Extensions | MIME Type |
91
+ |--------|-----------|-----------|
92
+ | PDF | `.pdf` | `application/pdf` |
93
+ | GIF | `.gif` | `image/gif` |
94
+ | TIFF | `.tiff`, `.tif` | `image/tiff` |
95
+ | JPEG | `.jpg`, `.jpeg` | `image/jpeg` |
96
+ | PNG | `.png` | `image/png` |
97
+ | BMP | `.bmp` | `image/bmp` |
98
+ | WebP | `.webp` | `image/webp` |
99
+ | HTML | `.html` | `text/html` (Layout Parser only) |
100
+ | Word OOXML | `.docx` | `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (Layout Parser only) |
101
+ | PowerPoint OOXML | `.pptx` | `application/vnd.openxmlformats-officedocument.presentationml.presentation` (Layout Parser only) |
102
+ | Excel OOXML | `.xlsx` | `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` (Layout Parser only) |
103
+
104
+ **Best practices:**
105
+ - Filter documents with `WHERE`/`LIMIT` in a subquery rather than processing the entire object table.
106
+ - Use `CREATE TABLE ... AS SELECT` to persist results and avoid re-processing.
107
+ - Handle `RESOURCE_EXHAUSTED` errors with BigQuery remote inference SQL scripts or the Dataform package for retry-until-complete iteration.
108
+ - Select only the processor-specific columns you need rather than `SELECT *`.
109
+ - Minimum 200 dpi for document scans; 300 dpi or higher recommended.
110
+
111
+ **Limitations:**
112
+ - Maximum **130 pages per document**. Rows with larger documents return an error.
113
+ - **120-second timeout per request.** Documents that take longer to process will fail.
114
+ - **Requests are processed in batches of 10.**
115
+ - Custom Splitter only supports PDF, TIFF, TIF, and GIF.
116
+ - See [Cloud AI service functions quotas](https://cloud.google.com/bigquery/quotas#cloud_ai_service_functions) for current rate limits.
117
+ - Some rows may show `RESOURCE EXHAUSTED` errors after job success — BigQuery retries internally, but parallel batch queries can exceed quota limits.
118
+
119
+ **Locations:** Models can only be created in the **US** and **EU** multi-regions. The dataset, connection, and Document AI processor must all be in the same region.
120
+
121
+ **Provisioned throughput:** Not specified. Subject to Document AI API quotas.
122
+
123
+ **BigFrames API:** No direct equivalent. Use `%%bigquery` magics or `session.read_gbq_query()` to execute ML.PROCESS_DOCUMENT SQL from BigFrames.
124
+
125
+ ---
@@ -0,0 +1,26 @@
1
+ # `ML.TRANSCRIBE`
2
+
3
+ > **Source:** [`bigquery-ai/reference/cloud-ai-service-models.md#mltranscribe`](https://github.com/statmike/bigquery-data-science/blob/main/bigquery-ai/reference/cloud-ai-service-models.md#mltranscribe)
4
+
5
+ - **Description:** Table-valued function that transcribes audio in an object table with Speech-to-Text V2, returning the finished text in a `STRING` column.
6
+ - [documentation](https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-transcribe) · [notebook](https://github.com/statmike/bigquery-data-science/blob/main/bigquery-ai/functions/ml_transcribe/ml_transcribe.ipynb) · [sql](https://github.com/statmike/bigquery-data-science/blob/main/bigquery-ai/functions/ml_transcribe/ml_transcribe.sql)
7
+
8
+ ```sql
9
+ SELECT * FROM ML.TRANSCRIBE(
10
+ MODEL `PROJECT_ID.DATASET.MODEL_NAME`,
11
+ { TABLE `PROJECT_ID.DATASET.OBJECT_TABLE` | (QUERY_STATEMENT) },
12
+ recognition_config => JSON '{"language_codes": ["en-US"], "model": "chirp", "auto_decoding_config": {}}');
13
+ ```
14
+
15
+ **Output:** `transcripts` (`STRING` — the full transcript), `ml_transcribe_result` (JSON), `ml_transcribe_status`, plus the object table columns.
16
+
17
+ **Worth knowing:**
18
+ - **The third argument is a named argument, not a `STRUCT`** — the only member of the family that breaks the convention. It is also **required** unless the model was created with `SPEECH_RECOGNIZER`. Both mistakes produce errors that print the signature: `ML.TRANSCRIBE(MODEL, TABLE, [recognition_config => JSON])`.
19
+ - **`chirp` is the only accepted `model`.** `chirp_2`, `long`, `short` and `telephony` are all rejected with *"Supported models are: chirp."*
20
+ - **`SPEECH_RECOGNIZER` is regional.** BigQuery accepts a recognizer only from `asia-southeast1`, `us-central1` or `europe-west4` — a constraint to weigh against a multi-region dataset before choosing a recognizer over a per-call config.
21
+ - **`language_codes` is echoed, not enforced.** Forcing `["en-US"]` on French audio still returns French, still reporting `en-US`. `["auto"]` detects and reports bare subtags (`fr`, `es`, `en`).
22
+ - **Some `features` keys void the row.** `enable_automatic_punctuation` and `enable_word_time_offsets` work; `enable_word_confidence`, `diarization_config` and `profanity_filter` each fail the row with *"Config contains unsupported fields"* — naming no field, so you find the culprit by bisecting the object.
23
+ - **The result JSON is keyed by URI.** `ml_transcribe_result.results[uri]…` — the accessor has to index the JSON with the row's own `uri` column, and long audio arrives as several segments, which the `transcripts` column concatenates for you.
24
+ - **It is not reproducible.** Identical calls with the cache off can return different transcripts. Transcribe once, persist, and treat the text as data rather than as a key.
25
+
26
+ ---
@@ -0,0 +1,27 @@
1
+ # `ML.TRANSLATE`
2
+
3
+ > **Source:** [`bigquery-ai/reference/cloud-ai-service-models.md#mltranslate`](https://github.com/statmike/bigquery-data-science/blob/main/bigquery-ai/reference/cloud-ai-service-models.md#mltranslate)
4
+
5
+ - **Description:** Table-valued function that translates a text column, or detects its language, using the Cloud Translation V3 API.
6
+ - [documentation](https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-translate) · [notebook](https://github.com/statmike/bigquery-data-science/blob/main/bigquery-ai/functions/ml_translate/ml_translate.ipynb) · [sql](https://github.com/statmike/bigquery-data-science/blob/main/bigquery-ai/functions/ml_translate/ml_translate.sql)
7
+
8
+ ```sql
9
+ SELECT * FROM ML.TRANSLATE(
10
+ MODEL `PROJECT_ID.DATASET.MODEL_NAME`,
11
+ { TABLE `PROJECT_ID.DATASET.TABLE` | (QUERY_STATEMENT) },
12
+ STRUCT('TRANSLATE_TEXT' AS translate_mode, 'LANGUAGE_CODE' AS target_language_code));
13
+ ```
14
+
15
+ | Argument | Values | Notes |
16
+ |---|---|---|
17
+ | `translate_mode` | `'TRANSLATE_TEXT'`, `'DETECT_LANGUAGE'` | Two modes in one function |
18
+ | `target_language_code` | ISO-639 code | **Required** for `TRANSLATE_TEXT`; `DETECT_LANGUAGE` does not take one |
19
+
20
+ **Output:** `ml_translate_result` (JSON), `ml_translate_status`, plus the input columns including `text_content`.
21
+
22
+ **Worth knowing:**
23
+ - **One target language per call, and it cannot come from a column.** `target_language_code` is a scalar in the `STRUCT`, evaluated once for the whole call; a column reference fails to compile with `Unrecognized name`. Fanning out over three languages is three calls unioned together, each re-reading and re-billing the source text.
24
+ - **The source language is detected for free** in `TRANSLATE_TEXT` mode — the result carries `detected_language_code` beside `translated_text`, so there is no reason to run `DETECT_LANGUAGE` first just to route rows. The two modes return different JSON shapes: `translations[]` versus `languages[]` with a confidence.
25
+ - **It is stable across runs.** The notebook compares run-to-run output with the query cache off, and puts `AI.GENERATE` on the same rows for contrast.
26
+
27
+ ---
@@ -0,0 +1,32 @@
1
+ # `ML.UNDERSTAND_TEXT`
2
+
3
+ > **Source:** [`bigquery-ai/reference/cloud-ai-service-models.md#mlunderstand_text`](https://github.com/statmike/bigquery-data-science/blob/main/bigquery-ai/reference/cloud-ai-service-models.md#mlunderstand_text)
4
+
5
+ - **Description:** Table-valued function that runs one of five Cloud Natural Language analyses over a text column.
6
+ - [documentation](https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-understand-text) · [notebook](https://github.com/statmike/bigquery-data-science/blob/main/bigquery-ai/functions/ml_understand_text/ml_understand_text.ipynb) · [sql](https://github.com/statmike/bigquery-data-science/blob/main/bigquery-ai/functions/ml_understand_text/ml_understand_text.sql)
7
+
8
+ ```sql
9
+ SELECT * FROM ML.UNDERSTAND_TEXT(
10
+ MODEL `PROJECT_ID.DATASET.MODEL_NAME`,
11
+ { TABLE `PROJECT_ID.DATASET.TABLE` | (QUERY_STATEMENT) },
12
+ STRUCT('ANALYZE_SENTIMENT' AS nlu_option, TRUE AS flatten_json_output));
13
+ ```
14
+
15
+ | `nlu_option` | What comes back |
16
+ |---|---|
17
+ | `ANALYZE_SENTIMENT` | Document and per-sentence sentiment, as a score and a magnitude |
18
+ | `ANALYZE_ENTITIES` | Named things in the text, with a type and a salience |
19
+ | `ANALYZE_ENTITY_SENTIMENT` | The same entities, each carrying its own sentiment |
20
+ | `ANALYZE_SYNTAX` | Tokens with part of speech, lemma and dependency edges |
21
+ | `CLASSIFY_TEXT` | Categories from a published, fixed taxonomy |
22
+
23
+ Two more arguments: `flatten_json_output` (`BOOL`) adds unpacked columns beside the JSON, and `encoding_type` (`'UTF8'`, `'UTF16'`, `'UTF32'`) turns on the text-span offsets. Its default is `NONE`, which means `begin_offset` is simply not computed — and when you do ask, the offsets are measured in that encoding's units, so UTF-8 and UTF-16 disagree on any accented text.
24
+
25
+ **Output:** `ml_understand_text_result` (JSON), `ml_understand_text_status`, the input columns, and — with `flatten_json_output` — the flattened columns.
26
+
27
+ **Worth knowing:**
28
+ - **Language support differs per analysis**, and an unsupported language fails **the row**, not the job. Measured: `ANALYZE_ENTITY_SENTIMENT` returns `INVALID_ARGUMENT: The language ko is not supported for entity_sentiment analysis.` for Korean and Vietnamese rows while the same call succeeds for the rest — entity sentiment supports fewer languages than sentiment does.
29
+ - **An empty sentiment object reads as `NULL`, not `0`.** An entity can come back with no sentiment, and the accessor cannot tell that apart from neutral unless you coalesce.
30
+ - **The taxonomy and the entity types are closed vocabularies.** That is the feature — the same text yields the same category next quarter — and the limit: if your business needs a category the taxonomy does not have, this is the wrong function.
31
+
32
+ ---
@@ -0,0 +1,128 @@
1
+ # Multimodal Input Patterns by Function
2
+
3
+ > **Source:** [`bigquery-ai/reference/unstructured-data-infrastructure.md#multimodal-input-patterns-by-function`](https://github.com/statmike/bigquery-data-science/blob/main/bigquery-ai/reference/unstructured-data-infrastructure.md#multimodal-input-patterns-by-function)
4
+
5
+ **Every multimodal AI function takes an `ObjectRef`.** What differs between them is only *where the reference goes in the call*: a field of a STRUCT prompt, the second slot of a tuple, a bare positional argument, or a named `content` parameter. There are four shapes, not four pipelines.
6
+
7
+ Where the `ObjectRef` comes from is an independent choice:
8
+
9
+ ```sql
10
+ OBJ.MAKE_REF('gs://bucket/doc.pdf', 'PROJECT.REGION.CONNECTION') -- inline, no table
11
+ ref -- object table column
12
+ ```
13
+
14
+ ### Shape 1: STRUCT Prompt (most generation functions + AI.IF)
15
+
16
+ Replace the STRING prompt with a STRUCT containing text and an array of `ObjectRef`. Works inline — no object table needed.
17
+
18
+ **Functions:** `AI.GENERATE`, `AI.GENERATE_TEXT`, `AI.GENERATE_TABLE`, `AI.GENERATE_BOOL`, `AI.GENERATE_DOUBLE`, `AI.GENERATE_INT`, `ML.GENERATE_TEXT`, `AI.IF`
19
+
20
+ ```sql
21
+ -- Scalar function (AI.GENERATE)
22
+ SELECT (AI.GENERATE(
23
+ STRUCT(
24
+ 'Summarize this document.' AS prompt,
25
+ [OBJ.MAKE_REF('gs://bucket/doc.pdf', 'PROJECT.REGION.CONNECTION')] AS object_refs
26
+ )
27
+ )).result;
28
+
29
+ -- TVF (AI.GENERATE_TEXT)
30
+ SELECT result
31
+ FROM AI.GENERATE_TEXT(
32
+ MODEL `project.dataset.model`,
33
+ (SELECT STRUCT(
34
+ 'Summarize this document.' AS prompt,
35
+ [OBJ.MAKE_REF('gs://bucket/doc.pdf', 'PROJECT.REGION.CONNECTION')] AS object_refs
36
+ ) AS prompt)
37
+ );
38
+
39
+ -- Managed function (AI.IF)
40
+ SELECT AI.IF(
41
+ STRUCT(
42
+ 'This document is a financial invoice' AS prompt,
43
+ [OBJ.MAKE_REF('gs://bucket/doc.pdf', 'PROJECT.REGION.CONNECTION')] AS object_refs
44
+ )
45
+ ) AS is_invoice;
46
+ ```
47
+
48
+ > The STRUCT's field *names* are not part of the contract — the function concatenates the fields in the order given, the way `CONCAT` would. `object_refs` is this project's convention because it says what the field holds; `object_ref_runtime` or anything else behaves identically.
49
+
50
+ ### Shape 2: Tuple Syntax (AI.SCORE)
51
+
52
+ `AI.SCORE` does not accept the STRUCT prompt. Pass a tuple of (scoring text, `ObjectRef`).
53
+
54
+ **Functions:** `AI.SCORE`
55
+
56
+ ```sql
57
+ -- Create an object table first
58
+ CREATE EXTERNAL TABLE `project.dataset.docs`
59
+ WITH CONNECTION `project.region.connection`
60
+ OPTIONS (object_metadata = 'SIMPLE', uris = ['gs://bucket/path/*.pdf']);
61
+
62
+ -- Score documents using tuple syntax
63
+ SELECT
64
+ uri,
65
+ AI.SCORE(
66
+ ('Rate the professionalism of this document on a scale of 0 to 1', ref)
67
+ ) AS professionalism
68
+ FROM `project.dataset.docs`;
69
+ ```
70
+
71
+ ### Shape 3: Direct Argument (AI.CLASSIFY, AI.AGG)
72
+
73
+ The reference is just an argument — no prompt STRUCT, no tuple. `AI.AGG` wraps it in a one-field `STRUCT` because that is how it takes any input.
74
+
75
+ **Functions:** `AI.CLASSIFY`, `AI.AGG`
76
+
77
+ ```sql
78
+ -- Classify straight off the object table's ref column
79
+ SELECT
80
+ uri,
81
+ AI.CLASSIFY(ref, ['invoice', 'receipt', 'contract', 'letter']) AS doc_type
82
+ FROM `project.dataset.docs`;
83
+
84
+ -- AI.AGG wraps the reference in a one-field STRUCT
85
+ SELECT AI.AGG(
86
+ STRUCT(ref),
87
+ 'Summarize the common themes across these documents.'
88
+ ) AS themes
89
+ FROM `project.dataset.docs`;
90
+ ```
91
+
92
+ `EXTERNAL_OBJECT_TRANSFORM(TABLE t, ['SIGNED_URL'])` is not required here — verified live 2026-09-15 against a 10-PDF object table, where the bare `ref` column and the transformed one returned the same classifications.
93
+
94
+ ### Shape 4: `content` Parameter (Embedding and similarity functions)
95
+
96
+ Embedding and similarity functions take the reference as the content argument rather than in a prompt. Requires a multimodal embedding endpoint (e.g., `multimodalembedding@001`).
97
+
98
+ **Functions:** `AI.EMBED`, `AI.GENERATE_EMBEDDING`, `ML.GENERATE_EMBEDDING`, `AI.SIMILARITY`
99
+
100
+ ```sql
101
+ -- AI.EMBED with inline ObjectRef
102
+ SELECT AI.EMBED(
103
+ OBJ.MAKE_REF('gs://bucket/image.jpg', 'PROJECT.REGION.CONNECTION'),
104
+ endpoint => 'multimodalembedding@001',
105
+ connection_id => 'PROJECT.REGION.CONNECTION'
106
+ ).result AS embedding;
107
+
108
+ -- AI.SIMILARITY with ObjectRef (returns a FLOAT64 directly, no .result accessor)
109
+ SELECT AI.SIMILARITY(
110
+ OBJ.MAKE_REF('gs://bucket/img1.jpg', 'PROJECT.REGION.CONNECTION'),
111
+ OBJ.MAKE_REF('gs://bucket/img2.jpg', 'PROJECT.REGION.CONNECTION'),
112
+ endpoint => 'multimodalembedding@001',
113
+ connection_id => 'PROJECT.REGION.CONNECTION'
114
+ ) AS similarity;
115
+ ```
116
+
117
+ ### Shape Summary
118
+
119
+ | Shape | Functions | Object Table Required? | Input Method |
120
+ |-------|-----------|----------------------|--------------|
121
+ | STRUCT prompt | AI.GENERATE, AI.GENERATE_TEXT, AI.GENERATE_TABLE, AI.GENERATE_BOOL, AI.GENERATE_DOUBLE, AI.GENERATE_INT, ML.GENERATE_TEXT, AI.IF | No | `STRUCT(text AS prompt, [refs] AS object_refs)` |
122
+ | Tuple | AI.SCORE | No (object table is the convenient source) | `('scoring text', ref)` |
123
+ | Bare argument | AI.CLASSIFY, AI.AGG | No (object table is the convenient source) | `AI.CLASSIFY(ref, categories)`, `AI.AGG(STRUCT(ref), prompt)` |
124
+ | `content` parameter | AI.EMBED, AI.SIMILARITY, AI.GENERATE_EMBEDDING, ML.GENERATE_EMBEDDING | No | Pass the `ObjectRef` as the content argument |
125
+ | Object table (document processing) | ML.PROCESS_DOCUMENT | Yes | Object table rows as input to Document AI processor |
126
+ | Not supported | VECTOR_SEARCH, AI.SEARCH, AI.FORECAST, AI.DETECT_ANOMALIES, AI.PREDICT, AI.EVALUATE | — | Text/numeric input only |
127
+
128
+ > **`ObjectRefRuntime` still works everywhere.** Nothing in this section is a breaking change — wrapping a reference in `OBJ.GET_ACCESS_URL` is accepted by every function above. It is simply no longer necessary, and `AI.AGG`'s Known Issues give a reason to prefer the unwrapped form.
@@ -0,0 +1,109 @@
1
+ # Object Tables
2
+
3
+ > **Source:** [`bigquery-ai/reference/unstructured-data-infrastructure.md#object-tables`](https://github.com/statmike/bigquery-data-science/blob/main/bigquery-ai/reference/unstructured-data-infrastructure.md#object-tables)
4
+
5
+ - **Description:** Read-only external tables over unstructured data objects in Cloud Storage. Each row corresponds to a Cloud Storage object, with columns for object metadata. Object tables use access delegation via a Cloud resource connection — users need access to the table, not direct access to Cloud Storage.
6
+ - **Use cases:** Indexing Cloud Storage objects for AI function processing, document analysis pipelines, image/video/audio inference, joining unstructured data results with structured BigQuery data.
7
+ - [introduction](https://cloud.google.com/bigquery/docs/object-table-introduction) · [create](https://cloud.google.com/bigquery/docs/object-table-create) · [DDL reference](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_external_table_statement)
8
+
9
+ **CREATE syntax:**
10
+ ```sql
11
+ CREATE [ OR REPLACE ] EXTERNAL TABLE [ IF NOT EXISTS ] `PROJECT_ID.DATASET.TABLE_NAME`
12
+ WITH CONNECTION { `PROJECT_ID.REGION.CONNECTION_ID` | DEFAULT }
13
+ OPTIONS (
14
+ object_metadata = 'SIMPLE',
15
+ uris = ['BUCKET_PATH'[, ...]],
16
+ [max_staleness = STALENESS_INTERVAL,]
17
+ [metadata_cache_mode = 'CACHE_MODE']
18
+ );
19
+ ```
20
+
21
+ **Example (minimal):**
22
+ ```sql
23
+ CREATE EXTERNAL TABLE `myproject.mydataset.documents`
24
+ WITH CONNECTION `myproject.us.myconnection`
25
+ OPTIONS (
26
+ object_metadata = 'SIMPLE',
27
+ uris = ['gs://mybucket/documents/*.pdf']
28
+ );
29
+ ```
30
+
31
+ **Example (with metadata caching):**
32
+ ```sql
33
+ CREATE EXTERNAL TABLE `myproject.mydataset.documents`
34
+ WITH CONNECTION `myproject.us.myconnection`
35
+ OPTIONS (
36
+ object_metadata = 'SIMPLE',
37
+ uris = ['gs://mybucket/*'],
38
+ max_staleness = INTERVAL 1 DAY,
39
+ metadata_cache_mode = 'AUTOMATIC'
40
+ );
41
+ ```
42
+
43
+ **Metadata columns:**
44
+
45
+ | Column | Type | Description |
46
+ |--------|------|-------------|
47
+ | `uri` | STRING | Cloud Storage URI (`gs://bucket/path/object`). |
48
+ | `generation` | INTEGER | Object version identifier. |
49
+ | `content_type` | STRING | MIME type of the object (e.g., `image/jpeg`, `application/pdf`). Defaults to `application/octet-stream` if not set. |
50
+ | `size` | INTEGER | Content length in bytes. |
51
+ | `md5_hash` | STRING | MD5 hash of the data, base64-encoded. |
52
+ | `updated` | TIMESTAMP | Last time the object's metadata was modified. |
53
+ | `metadata` | RECORD (REPEATED) | Custom metadata as key-value pairs (`name` STRING, `value` STRING). |
54
+ | `ref` | STRUCT (Preview) | `ObjectRef` value: `STRUCT<uri STRING, version STRING, authorizer STRING, details JSON>`. Created only if on the multimodal data preview allowlist. |
55
+
56
+ There is also a `data` pseudocolumn containing raw file bytes, used by `ML.DECODE_IMAGE`. It cannot be directly queried.
57
+
58
+ > **The image-preprocessing family lives in the sibling project** — `ML.DECODE_IMAGE`, `ML.RESIZE_IMAGE`, `ML.CONVERT_COLOR_SPACE`, `ML.CONVERT_IMAGE_TYPE`, documented in [`bigquery-ml/reference/model-free-functions.md`](https://github.com/statmike/bigquery-data-science/blob/main/bigquery-ml/reference/model-free-functions.md#image-preprocessing-functions-mldecode_image-mlresize_image-mlconvert_image_type-mlconvert_color_space) with a tested example in [`bigquery-ml/functions/image/`](https://github.com/statmike/bigquery-data-science/blob/main/bigquery-ml/functions/image). Two things carry over to any object-table work here: those four functions **require a BigQuery Editions reservation** and fail outright on on-demand pricing (verified live 2026-09-11; no official page says so), and `ML.DECODE_IMAGE` accepts **any** `BYTES` value, so the `data` pseudocolumn is the usual source rather than the only one.
59
+
60
+ **CREATE parameters:**
61
+
62
+ | Parameter | Type | Required | Default | Description |
63
+ |-----------|------|----------|---------|-------------|
64
+ | `object_metadata` | STRING | Required | -- | Must be `'SIMPLE'` for object tables. |
65
+ | `uris` | ARRAY\<STRING\> | Required | -- | Cloud Storage URIs. One `*` wildcard allowed per path. Multiple buckets supported. |
66
+ | `max_staleness` | INTERVAL | Optional | `0` (disabled) | Metadata cache staleness. Range: 30 minutes to 7 days. |
67
+ | `metadata_cache_mode` | STRING | Optional (required if `max_staleness > 0`) | -- | `'AUTOMATIC'` (system-refreshed every 30–60 min) or `'MANUAL'` (you call `BQ.REFRESH_EXTERNAL_METADATA_CACHE`). |
68
+
69
+ **Metadata caching:**
70
+ - Without caching, queries must list files from Cloud Storage — can take several minutes for large tables.
71
+ - With caching, queries use cached metadata. Set `max_staleness` and `metadata_cache_mode`.
72
+ - Automatic refresh: system-defined interval (30–60 min). Recommended: create a `BACKGROUND` reservation for refresh jobs.
73
+ - Manual refresh: `CALL BQ.REFRESH_EXTERNAL_METADATA_CACHE('project.dataset.table');`
74
+ - Cache expires after 7 days if not refreshed.
75
+
76
+ **Signed URLs (EXTERNAL_OBJECT_TRANSFORM):**
77
+ ```sql
78
+ SELECT uri, signed_url
79
+ FROM EXTERNAL_OBJECT_TRANSFORM(TABLE `mydataset.myobjecttable`, ['SIGNED_URL']);
80
+ ```
81
+ Signed URLs expire after 6 hours. Row-level access policies restrict which URLs a user can generate.
82
+
83
+ `EXTERNAL_OBJECT_TRANSFORM` also rewrites the table's `ref` column from an `ObjectRef` into a signed `ObjectRefRuntime`. **No AI function requires that rewrite** — they all take the `ObjectRef` directly. Use the transform when something outside the AI call needs a fetchable URL: a display link, delegated access for another consumer, a shorter-lived credential.
84
+
85
+ **Connection requirements:**
86
+ - Requires a **Cloud resource connection** (type: "Vertex AI remote models, remote functions, BigLake and Spanner").
87
+ - Connection's service account needs `roles/storage.objectViewer` on the Cloud Storage bucket.
88
+ - Connection must be in the same region as the dataset.
89
+
90
+ **AI function integration:** every one of these reads the `ref` column as-is — an `ObjectRef` — with no signing step in between.
91
+ - `ML.PROCESS_DOCUMENT` — document extraction via Document AI processors.
92
+ - `AI.GENERATE_TEXT` / `AI.GENERATE` — text generation from object data: `STRUCT(text AS prompt, [ref] AS object_refs)`.
93
+ - `AI.GENERATE_EMBEDDING` — embeddings from image/video data: a `content` column of `ObjectRef`.
94
+ - `AI.SCORE` — score documents using tuple syntax: `AI.SCORE(('text', ref))`.
95
+ - `AI.CLASSIFY` — classify documents: `AI.CLASSIFY(ref, categories)`.
96
+ - `ML.ANNOTATE_IMAGE` — image annotation via Cloud Vision API.
97
+ - `ML.TRANSCRIBE` — audio transcription via Speech-to-Text API.
98
+
99
+ **Limitations:**
100
+ - Read-only — cannot alter data or use DML.
101
+ - Maximum **60 million rows** (300 million in preview with allowlist).
102
+ - Maximum **10 GB of object metadata** per query.
103
+ - Not available in Legacy SQL, AWS, or Azure.
104
+ - `UNION ALL` combining empty and non-empty object tables may error.
105
+ - Signed URLs expire after 6 hours.
106
+
107
+ **Locations:** Any BigQuery region or multi-region. Connection must be colocated with the dataset.
108
+
109
+ ---
@@ -0,0 +1,50 @@
1
+ # ObjectRef and ObjectRefRuntime Schema Reference
2
+
3
+ > **Source:** [`bigquery-ai/reference/unstructured-data-infrastructure.md#objectref-and-objectrefruntime-schema-reference`](https://github.com/statmike/bigquery-data-science/blob/main/bigquery-ai/reference/unstructured-data-infrastructure.md#objectref-and-objectrefruntime-schema-reference)
4
+
5
+ **ObjectRef** — a STRUCT stored in BigQuery table columns:
6
+ ```sql
7
+ STRUCT<
8
+ uri STRING, -- Cloud Storage URI (gs://bucket/path/file)
9
+ version STRING, -- Cloud Storage object version
10
+ authorizer STRING, -- Cloud resource connection for access
11
+ details JSON -- Cloud Storage metadata (content_type, md5_hash, size, updated)
12
+ >
13
+ ```
14
+
15
+ **ObjectRefRuntime** — a JSON value produced by `OBJ.GET_ACCESS_URL`:
16
+ ```json
17
+ {
18
+ "obj_ref": { "uri", "version", "authorizer", "details" },
19
+ "access_urls": { "read_url", "write_url", "expiry_time" }
20
+ }
21
+ ```
22
+
23
+ **Array support:** `ARRAY<STRUCT<uri STRING, version STRING, authorizer STRING, details JSON>>` columns can store ordered collections of ObjectRef values (e.g., video frames). Use `ARRAY_AGG` with `ORDER BY` to aggregate and `UNNEST` with `WITH OFFSET` to decompose.
24
+
25
+ **Content requirements** (documented on `AI.GENERATE` and `AI.GENERATE_TEXT`, and applying wherever object references are accepted):
26
+ - Content must be in one of the formats the Gemini API's `mimeType` parameter supports.
27
+ - **At most one video object per input.** More than one is not rejected loudly — plan around the cap.
28
+ - Videos are truncated to **two minutes**; a longer video returns results based on its first two minutes only.
29
+
30
+ **Typical workflow:**
31
+ ```
32
+ URI string
33
+ → OBJ.MAKE_REF(uri, connection) → ObjectRef
34
+ → AI.GENERATE(STRUCT(prompt, ref)) → Generated output
35
+ ```
36
+
37
+ **Shortcut from object tables:** when the `ref` column is available (preview allowlist), skip `OBJ.MAKE_REF` too — the column already *is* an `ObjectRef`.
38
+
39
+ **Where the other two functions fit.** `OBJ.FETCH_METADATA` and `OBJ.GET_ACCESS_URL` are no longer steps on the path to an AI call; they are tools you reach for on purpose:
40
+
41
+ | You want | Call |
42
+ |----------|------|
43
+ | Feed an object to an AI function | Nothing — pass the `ObjectRef` |
44
+ | `content_type`, `size`, `md5_hash`, `updated` in SQL | `OBJ.FETCH_METADATA(objectref)` |
45
+ | Display the object in query results | `OBJ.GET_READ_URL(objectref)` |
46
+ | Hand a URL to a consumer outside BigQuery | `OBJ.GET_ACCESS_URL(objectref, 'r')` |
47
+ | Write a transformation output back to GCS | `OBJ.GET_ACCESS_URL(objectref, 'rw')` |
48
+ | An expiry shorter than the 6-hour default | `OBJ.GET_ACCESS_URL(objectref, 'r', INTERVAL 30 MINUTE)` |
49
+
50
+ ---
@@ -0,0 +1,49 @@
1
+ # `OBJ.FETCH_METADATA`
2
+
3
+ > **Source:** [`bigquery-ai/reference/unstructured-data-infrastructure.md#objfetch_metadata`](https://github.com/statmike/bigquery-data-science/blob/main/bigquery-ai/reference/unstructured-data-infrastructure.md#objfetch_metadata)
4
+
5
+ - **Description:** (Preview) Scalar function that fetches Cloud Storage metadata for a partially populated `ObjectRef` value. Takes an ObjectRef with `uri` and `authorizer` (typically from `OBJ.MAKE_REF`) and fills in the `details` field with `content_type`, `md5_hash`, `size`, and `updated` from Cloud Storage. Still succeeds on error — the `details` field contains an `error` field instead.
6
+ - **Use cases:** Populate ObjectRef columns with full metadata when not using object tables, refresh metadata for existing ObjectRef values after underlying objects change, combine with `OBJ.MAKE_REF` in a single expression: `OBJ.FETCH_METADATA(OBJ.MAKE_REF(uri, 'connection'))`.
7
+ - [documentation](https://cloud.google.com/bigquery/docs/reference/standard-sql/objectref_functions)
8
+ - **Type:** Scalar function (returns fully-populated ObjectRef STRUCT) — Preview
9
+
10
+ **Syntax:**
11
+ ```sql
12
+ OBJ.FETCH_METADATA(
13
+ objectref
14
+ )
15
+
16
+ OBJ.FETCH_METADATA(
17
+ ARRAY<objectref>
18
+ )
19
+ ```
20
+ The array overload fetches metadata for a whole `ARRAY<ObjectRef>` column in one call.
21
+
22
+ **Inputs:**
23
+
24
+ | Parameter | Type | Required | Description |
25
+ |-----------|------|----------|-------------|
26
+ | `objectref` | ObjectRef STRUCT | Required | Partially populated ObjectRef (with `uri` and `authorizer`). Typically from `OBJ.MAKE_REF()`. |
27
+
28
+ **Outputs:** Returns a fully populated `ObjectRef` STRUCT. The `details` JSON field contains:
29
+ ```json
30
+ {
31
+ "gcs_metadata": {
32
+ "content_type": "image/png",
33
+ "md5_hash": "d9c38814e44028bf7a012131941d5631",
34
+ "size": 23000,
35
+ "updated": 1741374857000000
36
+ }
37
+ }
38
+ ```
39
+ On error, `details` contains `{"errors": {"OBJ.FETCH_METADATA": "error message"}}` instead.
40
+
41
+ **Required permissions:** `bigquery.objectRefs.read` on the connection (from `roles/bigquery.objectRefReader` or `roles/bigquery.objectRefAdmin`). Connection service account needs `roles/storage.objectUser`.
42
+
43
+ **Limitations:**
44
+ - Same 20-connection limit per project+region.
45
+ - Less scalable than object tables for large numbers of objects (requires per-object metadata retrieval from Cloud Storage).
46
+
47
+ **Locations:** All BigQuery regions supporting Cloud resource connections.
48
+
49
+ ---
@@ -0,0 +1,66 @@
1
+ # `OBJ.GET_ACCESS_URL`
2
+
3
+ > **Source:** [`bigquery-ai/reference/unstructured-data-infrastructure.md#objget_access_url`](https://github.com/statmike/bigquery-data-science/blob/main/bigquery-ai/reference/unstructured-data-infrastructure.md#objget_access_url)
4
+
5
+ - **Description:** (Preview) Scalar function that converts an `ObjectRef` into an `ObjectRefRuntime` JSON value containing signed access URLs, with a caller-chosen mode (`'r'` / `'rw'`) and TTL.
6
+ - **Use cases:** Generate a **writable** signed URL for saving transformation outputs back to Cloud Storage, hand a read URL to a consumer outside BigQuery, pin an explicit expiry shorter than the 6-hour default.
7
+ - **Not needed to call an AI function.** Every multimodal `AI.*` function takes an `ObjectRef` directly; wrapping the reference in `OBJ.GET_ACCESS_URL` buys nothing but a longer query. See [Multimodal Input Patterns](multimodal-input-patterns-by-function.md).
8
+ - [documentation](https://cloud.google.com/bigquery/docs/reference/standard-sql/objectref_functions)
9
+ - **Type:** Scalar function (returns ObjectRefRuntime JSON) — Preview
10
+
11
+ **Syntax:**
12
+ ```sql
13
+ OBJ.GET_ACCESS_URL(
14
+ objectref,
15
+ mode
16
+ [, duration]
17
+ )
18
+
19
+ OBJ.GET_ACCESS_URL(
20
+ ARRAY<objectref>,
21
+ mode
22
+ [, duration]
23
+ )
24
+ ```
25
+ The array overload signs a whole `ARRAY<ObjectRef>` column in one call.
26
+
27
+ **Inputs:**
28
+
29
+ | Parameter | Type | Required | Default | Description |
30
+ |-----------|------|----------|---------|-------------|
31
+ | `objectref` | ObjectRef STRUCT | Required | -- | An ObjectRef value representing a Cloud Storage object. |
32
+ | `mode` | STRING | Required | -- | `'r'` for read-only URL, `'rw'` for read and write URLs. |
33
+ | `duration` | INTERVAL | Optional | `INTERVAL 6 HOUR` | URL validity period. Range: 30 minutes to 6 hours. |
34
+
35
+ **Outputs:** Returns `ObjectRefRuntime` JSON:
36
+ ```json
37
+ {
38
+ "obj_ref": {
39
+ "uri": "gs://bucket/file.jpg",
40
+ "version": "12345",
41
+ "authorizer": "us.connection1",
42
+ "details": {"gcs_metadata": {...}}
43
+ },
44
+ "access_urls": {
45
+ "read_url": "https://storage.googleapis.com/...",
46
+ "write_url": "https://storage.googleapis.com/...",
47
+ "expiry_time": "2024-01-15T18:30:00Z"
48
+ }
49
+ }
50
+ ```
51
+ On error, `access_urls` is replaced by `runtime_errors`.
52
+
53
+ **Required permissions:**
54
+ - Read URLs (`'r'`): `bigquery.objectRefs.read` (from `roles/bigquery.objectRefReader` or `roles/bigquery.objectRefAdmin`).
55
+ - Write URLs (`'rw'`): `bigquery.objectRefs.write` (from `roles/bigquery.objectRefAdmin` only).
56
+
57
+ **Accepted by AI functions:** yes — `ObjectRefRuntime` still works everywhere `ObjectRef` does, and `AI.AGG`'s reference page is the one that still specifies it. It is no longer the required form for any of them.
58
+
59
+ **Limitations:**
60
+ - Access URLs expire after at most 6 hours. Do not persist `ObjectRefRuntime` values long-term — regenerate from `ObjectRef` values.
61
+ - Same 20-connection limit per project+region.
62
+ - The `AI.AGG` page's Known Issues note that rows carrying arrays of `ObjectRefRuntime` values "might be skipped," and that some image objects created by `OBJ.GET_ACCESS_URL` "might fail to process." Passing the `ObjectRef` avoids both.
63
+
64
+ **Locations:** All BigQuery regions supporting Cloud resource connections.
65
+
66
+ ---