Halaman ini menjelaskan pratinjau yang memungkinkan Anda bereksperimen dengan mendaftarkan endpoint model AI dan memanggil prediksi dengan Pengelolaan endpoint model. Untuk menggunakan model AI di lingkungan produksi, lihat Membangun aplikasi AI generatif menggunakan AlloyDB AI dan Membuat embedding.
Setelah endpoint model ditambahkan dan didaftarkan di Pengelolaan endpoint model, Anda dapat mereferensikannya menggunakan ID model untuk membuat embedding.
[[["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-05 UTC."],[[["\u003cp\u003eThis preview feature allows you to experiment with registering AI model endpoints and invoking predictions using Model endpoint management.\u003c/p\u003e\n"],["\u003cp\u003eRegistered model endpoints can be referenced using their model ID to generate embeddings.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egoogle_ml.embedding()\u003c/code\u003e SQL function is used to call a registered model endpoint and generate embeddings.\u003c/p\u003e\n"],["\u003cp\u003eYou can register various text embedding models, such as \u003ccode\u003etextembedding-gecko@002\u003c/code\u003e, \u003ccode\u003etext-embedding-ada-002\u003c/code\u003e, \u003ccode\u003etext-embedding-3-small\u003c/code\u003e, and \u003ccode\u003etext-embedding-3-large\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThis feature is in a pre-GA stage, which means that it is available "as is", might have limited support and is subject to the Pre-GA Offerings Terms.\u003c/p\u003e\n"]]],[],null,["# Generate vector embeddings with model endpoint management\n\nSelect a documentation version: 15.5.4keyboard_arrow_down\n\n- [15.5.5](/alloydb/omni/15.5.5/docs/model-endpoint-embeddings)\n- [15.5.4](/alloydb/omni/15.5.4/docs/model-endpoint-embeddings)\n- [15.5.2](/alloydb/omni/15.5.2/docs/model-endpoint-embeddings)\n\n\u003cbr /\u003e\n\n|\n| **Preview\n| --- Model endpoint management**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis page describes a preview that lets you experiment with registering an AI model endpoint\nand invoking predictions with Model endpoint management. For using AI models in\nproduction environments, see [Build generative AI applications using\nAlloyDB AI](/alloydb/docs/ai) and [Generate embeddings](/alloydb/docs/ai/work-with-embeddings).\n\nAfter the model endpoints are added and registered in the Model endpoint management, you can\nreference them using the model ID to generate embeddings.\n\nBefore you begin\n----------------\n\nMake sure that you have registered your model endpoint with Model endpoint management. For\nmore information, see [Register a model endpoint with\nmodel endpoint management](/alloydb/omni/15.5.4/docs/model-endpoint-register-model)\n\nGenerate embeddings\n-------------------\n\nUse the `google_ml.embedding()` SQL function to call the registered model endpoint with\nthe text embedding model type to generate embeddings.\n\nTo call the model and generate embeddings, use the following SQL query: \n\n SELECT\n google_ml.embedding(\n model_id =\u003e '\u003cvar translate=\"no\"\u003eMODEL_ID\u003c/var\u003e',\n content =\u003e '\u003cvar translate=\"no\"\u003eCONTENT\u003c/var\u003e');\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eMODEL_ID\u003c/var\u003e: the model ID you defined when registering the model endpoint.\n- \u003cvar translate=\"no\"\u003eCONTENT\u003c/var\u003e: the text to translate into a vector embedding.\n\nExamples\n--------\n\nSome examples for generating embeddings using registered model endpoint are listed in this section.\n\n#### Text embedding models with in-built support\n\nTo generate embeddings for a registered `textembedding-gecko@002` model endpoint, run the following statement: \n\n SELECT\n google_ml.embedding(\n model_id =\u003e 'textembedding-gecko@002',\n content =\u003e 'AlloyDB is a managed, cloud-hosted SQL database service');\n\nTo generate embeddings for a registered `text-embedding-ada-002` model endpoint by OpenAI, run the following statement: \n\n SELECT\n google_ml.embedding(\n model_id =\u003e 'text-embedding-ada-002',\n content =\u003e 'e-mail spam');\n\n#### Other text embedding models\n\nTo generate embeddings for a registered `text-embedding-3-small` or `text-embedding-3-large` model endpoints by OpenAI, run the following statement: \n\n SELECT\n google_ml.embedding(\n model_id =\u003e 'text-embedding-3-small',\n content =\u003e 'Vector embeddings in AI');"]]