Conversational Analytics API: Tạo tác nhân dữ liệu và trò chuyện với dữ liệu của bạn
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Nhà phát triển có thể sử dụng API Phân tích trò chuyện (truy cập thông qua geminidataanalytics.googleapis.com) để tạo giao diện trò chuyện hoặc tác nhân dữ liệu dựa trên trí tuệ nhân tạo (AI) nhằm trả lời các câu hỏi về dữ liệu có cấu trúc trong BigQuery, Looker và Looker Studio bằng ngôn ngữ tự nhiên. Với API Phân tích trò chuyện, bạn cung cấp cho tác nhân dữ liệu thông tin và dữ liệu doanh nghiệp ("ngữ cảnh"), cũng như quyền truy cập vào các công cụ như SQL, Python và thư viện hình ảnh. Các phản hồi của trợ lý này được trình bày cho người dùng và có thể được ứng dụng khách ghi lại, tạo ra trải nghiệm trò chuyện bằng dữ liệu liền mạch và có thể kiểm tra.
Sau khi hoàn tất các bước trước, hãy sử dụng API Phân tích trò chuyện để tạo và tương tác với một tác nhân dữ liệu bằng cách làm theo các bước sau:
Tạo tác nhân dữ liệu bằng HTTP: Cung cấp ví dụ đầy đủ về cách tạo và tương tác với tác nhân dữ liệu bằng cách sử dụng các yêu cầu HTTP trực tiếp với Python.
Tạo cuộc trò chuyện nhiều lượt: Cung cấp hướng dẫn và ví dụ về cách xử lý các câu hỏi tiếp theo (cả có trạng thái và không có trạng thái) bằng cách sử dụng SDK Python.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Khó hiểu","hardToUnderstand","thumb-down"],["Thông tin hoặc mã mẫu không chính xác","incorrectInformationOrSampleCode","thumb-down"],["Thiếu thông tin/mẫu tôi cần","missingTheInformationSamplesINeed","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-06-11 UTC."],[],[],null,["# Conversational Analytics API: Build data agents and chat with your data\n\n| This product or 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 products and 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| **Important:** The Data QnA API is deprecated. If you're migrating from the Data QnA API, see the [migration guide](/gemini/docs/conversational-analytics-api/migration-guide) for an overview of key differences and required migration steps.\n\nDevelopers can use the Conversational Analytics API, which is accessed through `geminidataanalytics.googleapis.com`, to build an artificial intelligence (AI)-powered chat interface, or data agent, that answers questions about structured data in BigQuery, Looker, and Looker Studio using natural language. With the Conversational Analytics API, you provide your data agent with business information and data (\"context\"), as well as access to tools such as SQL, Python, and visualization libraries. These agent responses are presented to the user and can be logged by the client application, creating a seamless and auditable data chat experience.\n\nLearn [how and when Gemini\nfor Google Cloud uses your data](/gemini/docs/discover/data-governance).\n| As an early-stage technology, Gemini for Google Cloud\n| products can generate output that seems plausible but is factually incorrect. We recommend that you\n| validate all output from Gemini for Google Cloud products before you use it.\n| For more information, see\n| [Gemini for Google Cloud and responsible AI](/gemini/docs/discover/responsible-ai).\n| **Note:** Pre-GA Preview offerings (1) are intended for use in test environments only and shouldn't be used in a production environment or to process personal data or other data subject to legal or regulatory compliance requirements, and (2) are subject to the Pre-GA Offerings Terms of the [Service Specific Terms](/terms/service-terms#1), and the [Consent Addendum for Gemini for Google Cloud Trusted Tester Program](/trusted-tester/gemini-for-google-cloud-preview).\n\nGet started with the Conversational Analytics API\n-------------------------------------------------\n\nTo start using the Conversational Analytics API, you can first review the [architecture and key concepts](/gemini/docs/conversational-analytics-api/key-concepts) documentation to understand how agents process requests, the workflows for agent creators and users, conversation modes, and Identity and Access Management (IAM) roles. Then, to start building data agents, you can choose between a guided experience with the [Colaboratory notebooks](#interactive-colab-notebooks) or a self-driven approach by following the steps in [Setup and prerequisites](#setup).\n\n### Interactive Colaboratory notebooks\n\nFor an interactive, step-by-step guide to setting up your environment, building a data agent, and making API calls, see the following Colaboratory notebooks:\n\n- [Conversational Analytics API HTTP Colaboratory notebook](https://colab.research.google.com/github/GoogleCloudPlatform/generative-ai/blob/main/agents/gemini_data_analytics/intro_gemini_data_analytics_http.ipynb)\n- [Conversational Analytics API SDK Colaboratory notebook](https://colab.research.google.com/github/GoogleCloudPlatform/generative-ai/blob/main/agents/gemini_data_analytics/intro_gemini_data_analytics_sdk.ipynb)\n\n### Setup and prerequisites\n\nBefore you use the API or the examples, complete the following steps:\n\n- [Enable the Conversational Analytics API](/gemini/docs/conversational-analytics-api/enable-the-api): Describes prerequisites to enable the Conversational Analytics API.\n- [Grant Conversational Analytics API IAM roles and permissions](/gemini/docs/conversational-analytics-api/access-control): Describes the predefined IAM roles for managing access to data agents.\n- [Authenticate and connect to a data source with the Conversational Analytics API](/gemini/docs/conversational-analytics-api/authentication): Provides instructions for authenticating to the API and configuring connections to your BigQuery, Looker, and Looker Studio data.\n\n### Build and interact with a data agent\n\nAfter completing the previous steps, use the Conversational Analytics API to build and interact with a data agent by following these steps:\n\n- [Build a data agent using HTTP](/gemini/docs/conversational-analytics-api/build-agent-http): Provides a complete example of building and interacting with a data agent by using direct HTTP requests with Python.\n- [Build a data agent using the Python SDK](/gemini/docs/conversational-analytics-api/build-agent-sdk): Provides a complete example of building and interacting with a data agent by using the Python SDK.\n- [Write effective system instructions](/gemini/docs/conversational-analytics-api/data-agent-system-instructions): Learn how to structure the YAML content for the `system_instruction` parameter to guide agent behavior and improve response accuracy. You can also view examples of system instructions in [BigQuery data sources](/gemini/docs/conversational-analytics-api/data-agent-authored-context-bq) and in [Looker data sources](/gemini/docs/conversational-analytics-api/data-agent-authored-context-looker).\n- [Render a Conversational Analytics API agent response as a visualization](/gemini/docs/conversational-analytics-api/render-visualization): Provides an example of processing chart specifications from API responses and rendering them as visualizations by using the Python SDK and the Vega-Altair library.\n\nBest practices\n--------------\n\n- [Manage BigQuery costs for your agents](/gemini/docs/conversational-analytics-api/manage-costs): Learn how to monitor and manage BigQuery costs for your Conversational Analytics API agents by setting project-level, user-level, and query-level spending limits.\n\nKey API operations\n------------------\n\nThe API provides the following core endpoints for managing data agents and conversations:\n\nSend feedback\n-------------\n\nUse the following links to file a bug or request a feature.\n\n- [File a bug report](https://issuetracker.google.com/issues/new?component=1747873&template=2128893)\n- [File a feature request](https://issuetracker.google.com/issues/new?component=1747873&template=2131795)\n\nSend feedback\n-------------\n\nUse the following links to file a bug or request a feature.\n\n- [File a bug report](https://issuetracker.google.com/issues/new?component=1747873&template=2128893)\n- [File a feature request](https://issuetracker.google.com/issues/new?component=1747873&template=2131795)\n\nAdditional resources\n--------------------\n\n- [Conversational Analytics API reference documentation](/gemini/docs/conversational-analytics-api/reference/rest): Provides detailed descriptions of methods, endpoints, and type definitions for request and response structures.\n- [Troubleshoot Conversation Analytics API errors](/gemini/docs/conversational-analytics-api/troubleshoot-ca-errors): Troubleshoot common Conversation Analytics API errors."]]