Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bigframes/bigquery/_operations/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ def generate_bool(
... "col_1": ["apple", "bear", "pear"],
... "col_2": ["fruit", "animal", "animal"]
... })
>>> bbq.ai_generate_bool((df["col_1"], " is a ", df["col_2"]))
>>> bbq.ai.generate_bool((df["col_1"], " is a ", df["col_2"]))
0 {'result': True, 'full_response': '{"candidate...
1 {'result': True, 'full_response': '{"candidate...
2 {'result': False, 'full_response': '{"candidat...
dtype: struct<result: bool, full_response: string, status: string>[pyarrow]

>>> bbq.ai_generate_bool((df["col_1"], " is a ", df["col_2"])).struct.field("result")
>>> bbq.ai.generate_bool((df["col_1"], " is a ", df["col_2"])).struct.field("result")
0 True
1 True
2 False
Expand All @@ -66,7 +66,7 @@ def generate_bool(
... }
... }
... }
>>> bbq.ai_generate_bool(
>>> bbq.ai.generate_bool(
... (df["col_1"], " is a ", df["col_2"]),
... endpoint="gemini-2.5-pro",
... model_params=model_params,
Expand Down
11 changes: 2 additions & 9 deletions tests/system/large/bigquery/test_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import pandas as pd
import pandas.testing

import bigframes.bigquery as bbq


Expand All @@ -27,9 +24,5 @@ def test_ai_generate_bool_multi_model(session):
"result"
)

pandas.testing.assert_series_equal(
result.to_pandas(),
pd.Series([True, True, False, False, False], name="result"),
check_dtype=False,
check_index=False,
)
# Make sure all elements are not null
assert len(result) == result.count()
Comment thread
sycai marked this conversation as resolved.
Outdated