From 86b2cbd7f3d9c3a09bfcdb6dfde424e69613cf98 Mon Sep 17 00:00:00 2001 From: Shenyang Cai Date: Wed, 8 Oct 2025 02:35:16 +0000 Subject: [PATCH 1/5] doc: fix ai function related docs --- bigframes/bigquery/_operations/ai.py | 49 +++++++++++++++++++++++ docs/reference/bigframes.pandas/frame.rst | 5 +-- docs/templates/toc.yml | 3 +- 3 files changed, 52 insertions(+), 5 deletions(-) diff --git a/bigframes/bigquery/_operations/ai.py b/bigframes/bigquery/_operations/ai.py index 0c5eba9496..f20d4b69e4 100644 --- a/bigframes/bigquery/_operations/ai.py +++ b/bigframes/bigquery/_operations/ai.py @@ -48,6 +48,13 @@ def generate( """ Returns the AI analysis based on the prompt, which can be any combination of text and unstructured data. + .. note:: + + This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the + Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is" + and might have limited support. For more information, see the launch stage descriptions + (https://cloud.google.com/products#product-launch-stages). + **Examples:** >>> import bigframes.pandas as bpd @@ -143,6 +150,13 @@ def generate_bool( """ Returns the AI analysis based on the prompt, which can be any combination of text and unstructured data. + .. note:: + + This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the + Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is" + and might have limited support. For more information, see the launch stage descriptions + (https://cloud.google.com/products#product-launch-stages). + **Examples:** >>> import bigframes.pandas as bpd @@ -221,6 +235,13 @@ def generate_int( """ Returns the AI analysis based on the prompt, which can be any combination of text and unstructured data. + .. note:: + + This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the + Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is" + and might have limited support. For more information, see the launch stage descriptions + (https://cloud.google.com/products#product-launch-stages). + **Examples:** >>> import bigframes.pandas as bpd @@ -296,6 +317,13 @@ def generate_double( """ Returns the AI analysis based on the prompt, which can be any combination of text and unstructured data. + .. note:: + + This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the + Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is" + and might have limited support. For more information, see the launch stage descriptions + (https://cloud.google.com/products#product-launch-stages). + **Examples:** >>> import bigframes.pandas as bpd @@ -369,6 +397,13 @@ def if_( Evaluates the prompt to True or False. Compared to `ai.generate_bool()`, this function provides optimization such that not all rows are evaluated with the LLM. + .. note:: + + This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the + Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is" + and might have limited support. For more information, see the launch stage descriptions + (https://cloud.google.com/products#product-launch-stages). + **Examples:** >>> import bigframes.pandas as bpd >>> import bigframes.bigquery as bbq @@ -418,6 +453,13 @@ def classify( """ Classifies a given input into one of the specified categories. It will always return one of the provided categories best fit the prompt input. + .. note:: + + This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the + Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is" + and might have limited support. For more information, see the launch stage descriptions + (https://cloud.google.com/products#product-launch-stages). + **Examples:** >>> import bigframes.pandas as bpd @@ -469,6 +511,13 @@ def score( There is no fixed range for the score returned. To get high quality results, provide a scoring rubric with examples in the prompt. + .. note:: + + This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the + Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is" + and might have limited support. For more information, see the launch stage descriptions + (https://cloud.google.com/products#product-launch-stages). + **Examples:** >>> import bigframes.pandas as bpd diff --git a/docs/reference/bigframes.pandas/frame.rst b/docs/reference/bigframes.pandas/frame.rst index ea4c6dec1c..40f239ce4d 100644 --- a/docs/reference/bigframes.pandas/frame.rst +++ b/docs/reference/bigframes.pandas/frame.rst @@ -38,7 +38,4 @@ Struct handling AI operators ^^^^^^^^^^^^ -.. autoclass:: bigframes.operations.ai.AIAccessor - :members: - :inherited-members: - :undoc-members: \ No newline at end of file +.. automethod:: bigframes.operations.ai.AIAccessor.forecast \ No newline at end of file diff --git a/docs/templates/toc.yml b/docs/templates/toc.yml index ad96977152..f368cf21ae 100644 --- a/docs/templates/toc.yml +++ b/docs/templates/toc.yml @@ -219,7 +219,8 @@ - name: BigQuery built-in functions uid: bigframes.bigquery - name: BigQuery AI Functions - uid: bigframes.bigquery.ai + uid: bigframes.bigquery._operations.ai + status: beta name: bigframes.bigquery - items: - name: GeoSeries From 52faf5addbb32bbe111b6937a3106b7369fb9c9e Mon Sep 17 00:00:00 2001 From: Shenyang Cai Date: Wed, 8 Oct 2025 03:21:03 +0000 Subject: [PATCH 2/5] fix docs --- docs/reference/bigframes.pandas/frame.rst | 5 ++++- docs/templates/toc.yml | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/reference/bigframes.pandas/frame.rst b/docs/reference/bigframes.pandas/frame.rst index 40f239ce4d..ea4c6dec1c 100644 --- a/docs/reference/bigframes.pandas/frame.rst +++ b/docs/reference/bigframes.pandas/frame.rst @@ -38,4 +38,7 @@ Struct handling AI operators ^^^^^^^^^^^^ -.. automethod:: bigframes.operations.ai.AIAccessor.forecast \ No newline at end of file +.. autoclass:: bigframes.operations.ai.AIAccessor + :members: + :inherited-members: + :undoc-members: \ No newline at end of file diff --git a/docs/templates/toc.yml b/docs/templates/toc.yml index f368cf21ae..b44ea0d786 100644 --- a/docs/templates/toc.yml +++ b/docs/templates/toc.yml @@ -220,7 +220,6 @@ uid: bigframes.bigquery - name: BigQuery AI Functions uid: bigframes.bigquery._operations.ai - status: beta name: bigframes.bigquery - items: - name: GeoSeries From 090270b5657faba7e2c0ef592a3d147f604ba17b Mon Sep 17 00:00:00 2001 From: Shenyang Cai Date: Fri, 10 Oct 2025 18:52:49 +0000 Subject: [PATCH 3/5] fix format --- bigframes/bigquery/_operations/ai.py | 101 ++++++++++++++------------- docs/templates/toc.yml | 1 + 2 files changed, 52 insertions(+), 50 deletions(-) diff --git a/bigframes/bigquery/_operations/ai.py b/bigframes/bigquery/_operations/ai.py index 9038fb612c..b2e46480ec 100644 --- a/bigframes/bigquery/_operations/ai.py +++ b/bigframes/bigquery/_operations/ai.py @@ -49,13 +49,6 @@ def generate( """ Returns the AI analysis based on the prompt, which can be any combination of text and unstructured data. - .. note:: - - This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the - Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is" - and might have limited support. For more information, see the launch stage descriptions - (https://cloud.google.com/products#product-launch-stages). - **Examples:** >>> import bigframes.pandas as bpd @@ -72,13 +65,20 @@ def generate( 1 Ottawa\\n Name: result, dtype: string - You get structured output when the `output_schema` parameter is set: + You get structured output when the `output_schema` parameter is set: >>> animals = bpd.Series(["Rabbit", "Spider"]) >>> bbq.ai.generate(animals, output_schema={"number_of_legs": "INT64", "is_herbivore": "BOOL"}) 0 {'is_herbivore': True, 'number_of_legs': 4, 'f... 1 {'is_herbivore': False, 'number_of_legs': 8, '... dtype: struct>, status: string>[pyarrow] + + .. note:: + + This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the + Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is" + and might have limited support. For more information, see the launch stage descriptions + (https://cloud.google.com/products#product-launch-stages). Args: prompt (str | Series | List[str|Series] | Tuple[str|Series, ...]): @@ -151,13 +151,6 @@ def generate_bool( """ Returns the AI analysis based on the prompt, which can be any combination of text and unstructured data. - .. note:: - - This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the - Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is" - and might have limited support. For more information, see the launch stage descriptions - (https://cloud.google.com/products#product-launch-stages). - **Examples:** >>> import bigframes.pandas as bpd @@ -178,6 +171,13 @@ def generate_bool( 1 True 2 False Name: result, dtype: boolean + + .. note:: + + This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the + Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is" + and might have limited support. For more information, see the launch stage descriptions + (https://cloud.google.com/products#product-launch-stages). Args: prompt (str | Series | List[str|Series] | Tuple[str|Series, ...]): @@ -236,13 +236,6 @@ def generate_int( """ Returns the AI analysis based on the prompt, which can be any combination of text and unstructured data. - .. note:: - - This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the - Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is" - and might have limited support. For more information, see the launch stage descriptions - (https://cloud.google.com/products#product-launch-stages). - **Examples:** >>> import bigframes.pandas as bpd @@ -260,6 +253,13 @@ def generate_int( 1 4 2 8 Name: result, dtype: Int64 + + .. note:: + + This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the + Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is" + and might have limited support. For more information, see the launch stage descriptions + (https://cloud.google.com/products#product-launch-stages). Args: prompt (str | Series | List[str|Series] | Tuple[str|Series, ...]): @@ -318,13 +318,6 @@ def generate_double( """ Returns the AI analysis based on the prompt, which can be any combination of text and unstructured data. - .. note:: - - This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the - Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is" - and might have limited support. For more information, see the launch stage descriptions - (https://cloud.google.com/products#product-launch-stages). - **Examples:** >>> import bigframes.pandas as bpd @@ -342,6 +335,13 @@ def generate_double( 1 4.0 2 8.0 Name: result, dtype: Float64 + + .. note:: + + This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the + Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is" + and might have limited support. For more information, see the launch stage descriptions + (https://cloud.google.com/products#product-launch-stages). Args: prompt (str | Series | List[str|Series] | Tuple[str|Series, ...]): @@ -398,14 +398,8 @@ def if_( Evaluates the prompt to True or False. Compared to `ai.generate_bool()`, this function provides optimization such that not all rows are evaluated with the LLM. - .. note:: - - This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the - Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is" - and might have limited support. For more information, see the launch stage descriptions - (https://cloud.google.com/products#product-launch-stages). - **Examples:** + >>> import bigframes.pandas as bpd >>> import bigframes.bigquery as bbq >>> bpd.options.display.progress_bar = None @@ -420,6 +414,13 @@ def if_( 0 Massachusetts 1 Illinois dtype: string + + .. note:: + + This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the + Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is" + and might have limited support. For more information, see the launch stage descriptions + (https://cloud.google.com/products#product-launch-stages). Args: prompt (str | Series | List[str|Series] | Tuple[str|Series, ...]): @@ -454,13 +455,6 @@ def classify( """ Classifies a given input into one of the specified categories. It will always return one of the provided categories best fit the prompt input. - .. note:: - - This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the - Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is" - and might have limited support. For more information, see the launch stage descriptions - (https://cloud.google.com/products#product-launch-stages). - **Examples:** >>> import bigframes.pandas as bpd @@ -474,6 +468,13 @@ def classify( 1 Salmon Fish [2 rows x 2 columns] + + .. note:: + + This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the + Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is" + and might have limited support. For more information, see the launch stage descriptions + (https://cloud.google.com/products#product-launch-stages). Args: input (str | Series | List[str|Series] | Tuple[str|Series, ...]): @@ -512,13 +513,6 @@ def score( There is no fixed range for the score returned. To get high quality results, provide a scoring rubric with examples in the prompt. - .. note:: - - This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the - Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is" - and might have limited support. For more information, see the launch stage descriptions - (https://cloud.google.com/products#product-launch-stages). - **Examples:** >>> import bigframes.pandas as bpd @@ -530,6 +524,13 @@ def score( 1 1.0 2 3.0 dtype: Float64 + + .. note:: + + This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the + Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is" + and might have limited support. For more information, see the launch stage descriptions + (https://cloud.google.com/products#product-launch-stages). Args: prompt (str | Series | List[str|Series] | Tuple[str|Series, ...]): diff --git a/docs/templates/toc.yml b/docs/templates/toc.yml index b44ea0d786..f368cf21ae 100644 --- a/docs/templates/toc.yml +++ b/docs/templates/toc.yml @@ -220,6 +220,7 @@ uid: bigframes.bigquery - name: BigQuery AI Functions uid: bigframes.bigquery._operations.ai + status: beta name: bigframes.bigquery - items: - name: GeoSeries From 61a2acd1ccb63b754f0e5cd22f7accbc2e4a8767 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 10 Oct 2025 18:55:24 +0000 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- bigframes/bigquery/_operations/ai.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bigframes/bigquery/_operations/ai.py b/bigframes/bigquery/_operations/ai.py index b2e46480ec..f4302f8ece 100644 --- a/bigframes/bigquery/_operations/ai.py +++ b/bigframes/bigquery/_operations/ai.py @@ -72,7 +72,7 @@ def generate( 0 {'is_herbivore': True, 'number_of_legs': 4, 'f... 1 {'is_herbivore': False, 'number_of_legs': 8, '... dtype: struct>, status: string>[pyarrow] - + .. note:: This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the @@ -171,7 +171,7 @@ def generate_bool( 1 True 2 False Name: result, dtype: boolean - + .. note:: This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the @@ -253,7 +253,7 @@ def generate_int( 1 4 2 8 Name: result, dtype: Int64 - + .. note:: This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the @@ -335,7 +335,7 @@ def generate_double( 1 4.0 2 8.0 Name: result, dtype: Float64 - + .. note:: This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the @@ -414,7 +414,7 @@ def if_( 0 Massachusetts 1 Illinois dtype: string - + .. note:: This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the @@ -468,7 +468,7 @@ def classify( 1 Salmon Fish [2 rows x 2 columns] - + .. note:: This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the @@ -524,7 +524,7 @@ def score( 1 1.0 2 3.0 dtype: Float64 - + .. note:: This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the From 4fb713cd7d2f4d6a4d3a2cd71ffe4aa157f42125 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 10 Oct 2025 18:55:32 +0000 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- bigframes/bigquery/_operations/ai.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bigframes/bigquery/_operations/ai.py b/bigframes/bigquery/_operations/ai.py index b2e46480ec..f4302f8ece 100644 --- a/bigframes/bigquery/_operations/ai.py +++ b/bigframes/bigquery/_operations/ai.py @@ -72,7 +72,7 @@ def generate( 0 {'is_herbivore': True, 'number_of_legs': 4, 'f... 1 {'is_herbivore': False, 'number_of_legs': 8, '... dtype: struct>, status: string>[pyarrow] - + .. note:: This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the @@ -171,7 +171,7 @@ def generate_bool( 1 True 2 False Name: result, dtype: boolean - + .. note:: This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the @@ -253,7 +253,7 @@ def generate_int( 1 4 2 8 Name: result, dtype: Int64 - + .. note:: This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the @@ -335,7 +335,7 @@ def generate_double( 1 4.0 2 8.0 Name: result, dtype: Float64 - + .. note:: This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the @@ -414,7 +414,7 @@ def if_( 0 Massachusetts 1 Illinois dtype: string - + .. note:: This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the @@ -468,7 +468,7 @@ def classify( 1 Salmon Fish [2 rows x 2 columns] - + .. note:: This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the @@ -524,7 +524,7 @@ def score( 1 1.0 2 3.0 dtype: Float64 - + .. note:: This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the