Le estensioni di Vertex AI consentono ai modelli linguistici di grandi dimensioni (LLM) di connettersi a dati e azioni del mondo reale tramite API.
Le estensioni elaborano le query degli utenti e comunicano con i modelli linguistici di grandi dimensioni (LLM) per eseguire operazioni per conto di un'applicazione, ad esempio un'app di chat.
Ad esempio, supponiamo di creare un'estensione Vertex AI per un'API di noleggio auto e che questa estensione sia collegata
a un'applicazione di chat. Quando un utente chiede all'applicazione di noleggiare un'auto, l'AI generativa comprende il contesto della domanda e chiama l'API di estensione per noleggiare un'auto.
Figura 1. Estensione Vertex AI collegata a un'app di chat per l'assistenza clienti.
L'hub API semplifica la creazione di estensioni Vertex AI
L'hub API semplifica il processo di creazione di un'estensione Vertex AI utilizzando i metadati dell'hub API esistenti. I dati chiave utilizzati dall'hub API per creare un'estensione sono una specifica dell'API e un deployment, che, comodamente, sono giร convalidati dall'hub API. La specifica fornisce le operazioni dell'API all'estensione e il deployment fornisce l'endpoint del server dell'API.
Crea un'estensione Vertex AI
Per creare un'estensione Vertex AI in API Hub:
Console
Per creare un'estensione:
Nella console Google Cloud, vai alla pagina API in API Hub.
Individua l'API a cui vuoi aggiungere un'estensione. Utilizza Filtra per specificare le parole chiave per filtrare l'elenco di API.
Se necessario, utilizza la Ricerca per trovare un'API.
Fai clic sull'API per visualizzarne la pagina dei dettagli.
Fai clic su Crea estensione Vertex.
Specifica i dettagli dell'estensione nel modulo Crea un'estensione Vertex:
Nome dell'estensione : (obbligatorio) devi fornire un nome per l'estensione.
Descrizione: (obbligatorio) aggiungi una descrizione dell'estensione.
Versione: (obbligatorio) seleziona una versione dell'API.
File di specifiche: (obbligatorio) se una specifica รจ collegata alla versione dell'API, viene compilata automaticamente in questo campo. Consulta Gestire le specifiche dell'API.
Deployment: (obbligatorio) se un deployment รจ collegato alla versione dell'API, viene compilato automaticamente in questo campo. Vedi
Gestire i deployment.
Fai clic su Crea estensione. Se aggiungi l'estensione alla versione predefinita, questa verrร visualizzata nella sezione Estensioni della pagina dei dettagli dell'API. Se hai aggiunto l'estensione a un'altra versione, dovrai visualizzare la pagina dei dettagli della versione per vedere l'estensione elencata.
Elenca le estensioni Vertex AI
Questa sezione spiega come elencare le estensioni dei vertici.
Console
Per visualizzare tutte le estensioni associate a un'API registrata nella console:
Nella console Google Cloud, vai alla pagina Hub API.
Individua l'API che vuoi esaminare. Utilizza Filtra per specificare le parole chiave per filtrare l'elenco di API.
Se necessario, utilizza la Ricerca per trovare un'API.
Seleziona un'API.
Le estensioni aggiunte alla versione predefinita sono elencate nella sezione Estensioni della pagina dei dettagli dell'API. Se un'estensione รจ stata aggiunta a un'altra versione, dovrai visualizzare la pagina dei dettagli della versione per visualizzarla.
Visualizzare i dettagli dell'estensione Vertex AI
Questa sezione spiega come ottenere i dettagli di un'estensione Vertex AI.
Console
Per visualizzare i dettagli dell'estensione Vertex AI nella console:
Nella console Google Cloud, vai alla pagina Hub API.
Individua l'API che vuoi esaminare. Utilizza Filtra per specificare le parole chiave per filtrare l'elenco di API.
Se necessario, utilizza la Ricerca per trovare un'API.
Seleziona un'API.
Tutte le estensioni aggiunte alla versione predefinita sono elencate nella sezione Estensioni della pagina dei dettagli dell'API. Se un'estensione รจ stata aggiunta a un'altra versione, dovrai visualizzare la pagina dei dettagli della versione per visualizzarla. Nella tabella Estensioni vertice, fai clic su un'estensione per visualizzarne la pagina dei dettagli.
Eliminare un'estensione Vertex AI
Questa sezione spiega come eliminare un'estensione Vertex.
Console
Per eliminare un'estensione:
Nella console Google Cloud, vai alla pagina Hub API.
Individua l'API che include l'estensione che vuoi eliminare. Utilizza Filtra per specificare le parole chiave per filtrare l'elenco di API.
Se necessario, utilizza la Ricerca per trovare un'API.
Seleziona un'API.
Individua l'estensione da eliminare.
Le estensioni aggiunte alla versione predefinita sono elencate nella sezione Estensioni della pagina dei dettagli dell'API. Se un'estensione รจ stata aggiunta a un'altra versione, dovrai visualizzare la pagina dei dettagli della versione per visualizzarla.
Nel menu Azioni (lato destro della riga contenente l'estensione),
fai clic su Elimina.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema รจ stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-03 UTC."],[[["\u003cp\u003eThis guide outlines the process of creating, listing, viewing, and deleting Vertex AI extensions within API hub, which applies to both Apigee and Apigee hybrid.\u003c/p\u003e\n"],["\u003cp\u003eVertex AI extensions enable large language models (LLMs) to interact with real-world data and actions through APIs, streamlining integration with applications like chat services.\u003c/p\u003e\n"],["\u003cp\u003eAPI hub simplifies the creation of Vertex AI extensions by leveraging existing API metadata, including API specifications and deployments, already validated within API hub.\u003c/p\u003e\n"],["\u003cp\u003eCreating a Vertex AI extension requires specifying details like the extension's name, description, API version, specification file, deployment, and optional authentication settings.\u003c/p\u003e\n"],["\u003cp\u003eExtensions can be viewed, managed, and deleted through the API hub console by navigating to the respective API's details page and accessing the extensions section, either in the default version or a specific version's details.\u003c/p\u003e\n"]]],[],null,["# Create Vertex AI extensions\n\n*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\nThis topic explains how to create [Vertex AI extensions](/vertex-ai/generative-ai/docs/extensions/overview) within API hub.\n\nWhat is a Vertex AI extension?\n------------------------------\n\nVertex AI extensions allow LLMs to connect to real-world data and actions through APIs.\nExtensions process user queries and communicate\nwith large language models (LLMs) to execute operations on behalf of an application, such as\na chat app.\n\nFor example, suppose you create a Vertex AI extension for a car rental API, and this extension is linked\nto a chat application. When a user asks the application about renting a car, the generative AI understands\nthe context of the question and calls the extension API to rent a car.\n**Figure 1.** Vertex AI extension connected to a customer-service chat app.\n\nFor more information about Vertex AI extensions, see [Extensions overview](/vertex-ai/generative-ai/docs/extensions/overview).\n\nAPI hub streamlines Vertex AI extension creation\n------------------------------------------------\n\nAPI hub streamlines the process of creating a Vertex AI extension by using existing API hub\nmetadata. The key data used by API hub to create an extension are an API specification and\na deployment, which, conveniently, are already validated by API hub. The specification provides the operations of the API to the extension, and the\ndeployment provides the server endpoint of the API.\n\nCreate a Vertex AI extension\n----------------------------\n\nTo create a Vertex AI extension in API hub: \n\n### Console\n\nTo create an extension:\n\n1. In the Google Cloud console, go to the **APIs** page in **API hub**.\n\n [Go to API hub](https://console.cloud.google.com/apigee/api-hub/apis)\n2. Locate the API where you want to add an extension. Use [Filter](./search-apis#filter) to specify keywords to filter the list of APIs. If needed, use [Search](./search-apis) to locate an API.\n3. Click the API to view its details page.\n4. Click **Create Vertex Extension**.\n5. Specify extension details in the **Create a Vertex Extension** form:\n 1. **Extension name:** (Required) Enter a name for the extension.\n 2. **Description**: (Required) Add a description of the extension.\n 3. **Version**: (Required) Select an API version.\n 4. **Specification file** : (Required) If a specification is linked to the API version, it is automatically populated in this field. See [Manage API specifications](./manage-specifications). Vertex AI extension only supports OpenAPI specification files in YAML format. The spec file size limit is 1 MB.\n 5. **Deployment** : (Required) If a deployment is linked to the API version, it is automatically populated in this field. See [Manage deployments](./manage-api-deployments). **Note:** Because Vertex extensions only support one server endpoint per specification, we cannot allow deployments with multiple server endpoints. If a deployment contains multiple endpoints, we pick the first one.\n 6. **Authentication** : (Optional) Select an authentication type. The following authentication types are supported:\n - **No authentication**: Select this option if your extension does not require authentication.\n - **API key** : Use an API key for authentication. If selected, provide the following inputs:\n 1. **Parameter name**: Enter the name of the API key.\n 2. **API key Secret** : Enter the Secret Manager resource string that stores your API key. Use one of the following formats:\n - Global Secret: `projects/`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`/secrets/`\u003cvar translate=\"no\"\u003eSECRET_ID\u003c/var\u003e`/versions/`\u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e\n - Regional Secret: `projects/`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`/locations/`\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e`/secrets/`\u003cvar translate=\"no\"\u003eSECRET_ID\u003c/var\u003e`/versions/`\u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e\n\n Where:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your Google Cloud project ID.\n - \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: The region where the secret is stored (for example, `us-central1`). This is only required for regional secrets.\n - \u003cvar translate=\"no\"\u003eSECRET_ID\u003c/var\u003e: The name of your Secret Manager secret.\n - \u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e: The version of the secret.\n\n For more information about Secret Manager, see [Secret Manager documentation](/secret-manager/docs).\n 3. **HTTP element location**: Choose the location where the API key is stored in the HTTP request.\n - **HTTP basic** : Use HTTP basic authentication. If selected, provide the [SecretManager](/secret-manager) secret version resource that stores the base64-encoded credential in the **Credential secret** field. Use one of the following formats:\n - Global Secret: `projects/`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`/secrets/`\u003cvar translate=\"no\"\u003eSECRET_ID\u003c/var\u003e`/versions/`\u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e\n - Regional Secret: `projects/`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`/locations/`\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e`/secrets/`\u003cvar translate=\"no\"\u003eSECRET_ID\u003c/var\u003e`/versions/`\u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e\n\n Where:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your Google Cloud project ID.\n - \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: The region where the secret is stored (for example, `us-central1`). This is only required for regional secrets.\n - \u003cvar translate=\"no\"\u003eSECRET_ID\u003c/var\u003e: The name of your Secret Manager secret.\n - \u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e: The version of the secret.\n\n To learn more about authentication types, see [Authentication configuration](/vertex-ai/generative-ai/docs/extensions/create-extension#authentication_configuration).\n6. Click **Create Extension**. If you add the extension to the default version, the extension will show up in the Extensions section of the API details page. If you added the extension to another version, you'll have to view the version's details page to see the extension listed there.\n\nList Vertex AI extensions\n-------------------------\n\nThis section explains how to list vertex extensions. \n\n### Console\n\nTo view all the extensions associated with a registered API in the console:\n\n1. In the Google Cloud console, go to the **API hub** page.\n\n [Go to API hub](https://console.cloud.google.com/apigee/api-hub/apis)\n2. Click **APIs**.\n3. Locate the API you wish to inspect. Use [Filter](./search-apis#filter) to specify keywords to filter the list of APIs. If needed, use [Search](./search-apis) to locate an API.\n4. Select an API.\n5. Any extensions that were added to the default version are listed in the Extensions section of the API details page. If an extension was added to another version, you'll have to view the version's details page to see the extension listed there.\n\nGet Vertex AI extension details\n-------------------------------\n\nThis section explains how to get the details about a Vertex AI extension. \n\n### Console\n\nTo view Vertex AI extension details in the console:\n\n1. In the Google Cloud console, go to the **API hub** page.\n\n [Go to API hub](https://console.cloud.google.com/apigee/api-hub/apis)\n2. Click **APIs**.\n3. Locate the API you wish to inspect. Use [Filter](./search-apis#filter) to specify keywords to filter the list of APIs. If needed, use [Search](./search-apis) to locate an API.\n4. Select an API.\n5. Any extensions that were added to the default version are listed in the Extensions section of the API details page. If an extension was added to another version, you'll have to view the version's details page to see the extension listed there. In the **Vertex extensions** table, click an extension to see its details page.\n\nDelete a Vertex AI extension\n----------------------------\n\nThis section explains how to delete a Vertex extension. \n\n### Console\n\nTo delete an extension:\n\n1. In the Google Cloud console, go to the **API hub** page.\n\n [Go to API hub](https://console.cloud.google.com/apigee/api-hub/apis)\n2. Click **APIs**.\n3. Locate the API that includes the extension you wish to delete. Use [Filter](./search-apis#filter) to specify keywords to filter the list of APIs. If needed, use [Search](./search-apis) to locate an API.\n4. Select an API.\n5. Locate the extension to delete. Any extensions that were added to the default version are listed in the Extensions section of the API details page. If an extension was added to another version, you'll have to view the version's details page to see the extension listed there.\n6. From the **Actions** menu (the right side of the row containing the extension), click **Delete**."]]