이 페이지에서는 기업 규정 준수 관리를 위한 웹 그라운딩과 엔터프라이즈용 웹 그라운딩 API를 사용하여 웹에서 그라운딩된 응답을 생성하는 방법을 설명합니다. 색인이 생성된 콘텐츠는 Google 검색에서 사용할 수 있는 콘텐츠의 하위 집합이며 금융, 의료, 공공 부문과 같이 규제가 엄격한 업종의 고객에게 적합합니다.
# Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values# with appropriate values for your project.exportGOOGLE_CLOUD_PROJECT=GOOGLE_CLOUD_PROJECTexportGOOGLE_CLOUD_LOCATION=globalexportGOOGLE_GENAI_USE_VERTEXAI=True
fromgoogleimportgenaifromgoogle.genai.typesimport(EnterpriseWebSearch,GenerateContentConfig,HttpOptions,Tool,)client=genai.Client(http_options=HttpOptions(api_version="v1"))response=client.models.generate_content(model="gemini-2.5-flash",contents="When is the next total solar eclipse in the United States?",config=GenerateContentConfig(tools=[# Use Enterprise Web Search ToolTool(enterprise_web_search=EnterpriseWebSearch())],),)print(response.text)# Example response:# 'The next total solar eclipse in the United States will occur on ...'
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-16(UTC)"],[],[],null,["This page describes Web Grounding for Enterprise compliance controls and how to use\nthe Web Grounding for Enterprise API to generate responses that are grounded on the\nweb. The indexed content is a subset of what's available on\nGoogle Search and suitable for customers in highly-regulated\nindustries, such as finance, healthcare, and the public sector.\n\nIf you don't require the compliance controls, use [Ground with\nGoogle Search](/vertex-ai/generative-ai/docs/grounding/ground-with-google-search),\nbecause it offers access to a broader web index.\n\nOverview\n\nWeb Grounding for Enterprise uses a web index that is used to generate grounded\nresponses. The service doesn't log customer data and supports [VPC Service Controls](/vertex-ai/generative-ai/docs/security-controls).\nBecause no customer data is persisted, customer-managed encryption keys (CMEK)\nand Access Transparency (AxT) aren't applicable.\n\nUse the API\n\nThis section provides sample requests of using the Generative AI API [Gemini 2](/vertex-ai/generative-ai/docs/gemini-v2) on\nVertex AI to create grounded responses with Gemini. To use the API, you\nmust set the following fields:\n\n- **`Contents.parts.text`**: The text query users want to send to the API.\n- **`tools.enterpriseWebSearch`**: When this tool is provided, Web Grounding for Enterprise can be used by Gemini.\n\nPython\n\nInstall \n\n```\npip install --upgrade google-genai\n```\n\n\nTo learn more, see the\n[SDK reference documentation](https://googleapis.github.io/python-genai/).\n\n\nSet environment variables to use the Gen AI SDK with Vertex AI:\n\n```bash\n# Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values\n# with appropriate values for your project.\nexport GOOGLE_CLOUD_PROJECT=GOOGLE_CLOUD_PROJECT\nexport GOOGLE_CLOUD_LOCATION=global\nexport GOOGLE_GENAI_USE_VERTEXAI=True\n```\n\n\u003cbr /\u003e\n\n from google import genai\n from google.genai.types import (\n EnterpriseWebSearch,\n GenerateContentConfig,\n HttpOptions,\n Tool,\n )\n\n client = genai.Client(http_options=HttpOptions(api_version=\"v1\"))\n\n response = client.models.generate_content(\n model=\"gemini-2.5-flash\",\n contents=\"When is the next total solar eclipse in the United States?\",\n config=GenerateContentConfig(\n tools=[\n # Use Enterprise Web Search Tool\n Tool(enterprise_web_search=EnterpriseWebSearch())\n ],\n ),\n )\n\n print(response.text)\n # Example response:\n # 'The next total solar eclipse in the United States will occur on ...'\n\nREST Replace the following variables with values:\n\n\u003cbr /\u003e\n\n- **\u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e**: Your project number.\n- **\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e**: Your region.\n- **\u003cvar translate=\"no\"\u003eTEXT\u003c/var\u003e**: Your prompt.\n\n curl -X POST -H \"Authorization: Bearer $(gcloud auth print-access-token)\" -H \"Content-Type: application/json\" -H \"x-server-timeout: 60\" https://\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e-aiplatform.googleapis.com/v1/projects/\u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e/locations/\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e/publishers/google/models/gemini-2.0-flash:generateContent -d '\n {\n \"contents\": [{\n \"role\": \"user\",\n \"parts\": [{\n \"text\": \u003cvar translate=\"no\"\u003eTEXT\u003c/var\u003e\n }]\n }],\n \"tools\": [{\n \"enterpriseWebSearch\": {\n }\n }]\n }\n '\n\n\u003cbr /\u003e\n\nWhat's next\n\n- To learn more about how to ground Gemini models to your data, see [Grounding with Vertex AI Search](/vertex-ai/generative-ai/docs/grounding/grounding-with-vertex-ai-search).\n- To learn more about responsible AI best practices and Vertex AI's safety filters, see [Responsible AI](/vertex-ai/generative-ai/docs/learn/responsible-ai)."]]