Supprimer un site Web du data store
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Supprimer un site Web du data store
Exemple de code
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],[],[[["\u003cp\u003eThis content demonstrates how to remove a website from a data store using the Vertex AI Agent Builder Python API.\u003c/p\u003e\n"],["\u003cp\u003eThe provided code snippet illustrates the process of deleting a target site by its resource name, requiring project ID, location, data store ID, and target site ID.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication to Vertex AI Agent Builder is necessary and can be set up using Application Default Credentials as per the documentation provided.\u003c/p\u003e\n"],["\u003cp\u003eThe code shows how to configure a client for interacting with the Site Search Engine Service, with specific attention to multi-region setup.\u003c/p\u003e\n"],["\u003cp\u003eFor additional code samples and products, the Google Cloud sample browser is a useful resource, as described in the content.\u003c/p\u003e\n"]]],[],null,["# Remove website from data store\n\nCode sample\n-----------\n\n### Python\n\n\nFor more information, see the\n[AI Applications Python API\nreference documentation](/python/docs/reference/discoveryengine/latest).\n\n\nTo authenticate to AI Applications, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n # from google.api_core.client_options import ClientOptions\n #\n # from google.cloud import discoveryengine_v1 as discoveryengine\n #\n # # TODO(developer): Uncomment these variables before running the sample.\n # # project_id = \"YOUR_PROJECT_ID\"\n # # location = \"YOUR_LOCATION\" # Values: \"global\"\n # # data_store_id = \"YOUR_DATA_STORE_ID\"\n # # target_site_id = \"YOUR_TARGET_SITE_ID\"\n #\n # # For more information, refer to:\n # # https://cloud.google.com/generative-ai-app-builder/docs/locations#specify_a_multi-region_for_your_data_store\n # client_options = (\n # ClientOptions(api_endpoint=f\"{location}-discoveryengine.googleapis.com\")\n # if location != \"global\"\n # else None\n # )\n #\n # # Create a client\n # client = discoveryengine.SiteSearchEngineServiceClient(\n # client_options=client_options\n # )\n #\n # # The full resource name of the data store\n # # e.g. projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/siteSearchEngine/targetSites/{target_site}\n # name = client.target_site_path(\n # project=project_id,\n # location=location,\n # data_store=data_store_id,\n # target_site=target_site_id,\n # )\n #\n # # Make the request\n # operation = client.delete_target_site(name=name)\n #\n # print(f\"Operation: {operation.operation.name}\")\n\nWhat's next\n-----------\n\n\nTo search and filter code samples for other Google Cloud products, see the\n[Google Cloud sample browser](/docs/samples?product=genappbuilder)."]]