Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Halaman ini menjelaskan cara memanggil prediksi menggunakan fungsi dari namespace public dan google_ml. Ekstensi google_ml_integration mencakup fungsi prediksi untuk namespace ini.
Anda dapat menggunakan fungsi ml_predict_row() dalam skema public dengan model generik apa pun yang dihosting di Vertex AI tanpa mendaftarkan endpoint. Fungsi google_ml.predict_row() dalam skema google_ml dapat digunakan dengan model apa pun yang telah didaftarkan dengan pengelolaan endpoint Model.
Untuk memanggil prediksi, pilih salah satu skema berikut.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-02 UTC."],[[["\u003cp\u003eAlloyDB allows online predictions within SQL code using the \u003ccode\u003egoogle_ml.predict_row()\u003c/code\u003e function.\u003c/p\u003e\n"],["\u003cp\u003eBefore invoking predictions, you must integrate your database with Vertex AI and grant users permission to execute \u003ccode\u003egoogle_ml.predict_row()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egoogle_ml.predict_row()\u003c/code\u003e function requires you to specify a Vertex AI Model Garden model or a Vertex AI model endpoint with accessible IAM permissions.\u003c/p\u003e\n"],["\u003cp\u003eThe format of the initial argument in \u003ccode\u003egoogle_ml.predict_row()\u003c/code\u003e varies depending on whether you are using a Vertex AI Model Garden model or a Vertex AI endpoint.\u003c/p\u003e\n"],["\u003cp\u003eYou can utilize the \u003ccode\u003ejson_build_object()\u003c/code\u003e function with \u003ccode\u003egoogle_ml.predict_row()\u003c/code\u003e to format function parameters, including using database content as input.\u003c/p\u003e\n"]]],[],null,["# Invoke predictions\n\nThis page describes how to invoke predictions using functions from the `public` and `google_ml` namespaces. The `google_ml_integration` extension includes prediction functions for these namespaces.\n\nYou can use the `ml_predict_row()` function in the `public` schema with any generic model hosted in Vertex AI without registering the endpoint. The `google_ml.predict_row()` function in the `google_ml` schema can be used with any model that has been [registered with Model endpoint management](/alloydb/docs/ai/register-model-endpoint).\n\nTo invoke predictions, select one of the following schemas. \npublic schema google_ml schema\n\nWhat's next\n-----------\n\n- [Learn how to build a smart shopping assistant with AlloyDB, pgvector, and model endpoint management](https://codelabs.developers.google.com/smart-shop-agent-alloydb#0)."]]