File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
tests/system/small/bigquery Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15+ import sys
16+
1517import pandas as pd
1618import pandas .testing
19+ import pytest
1720
1821import bigframes .bigquery as bbq
1922import bigframes .pandas as bpd
@@ -35,3 +38,26 @@ def test_ai_generate_bool(session):
3538 check_dtype = False ,
3639 check_index = False ,
3740 )
41+
42+
43+ def test_ai_generate_bool_with_model_params (session ):
44+ if sys .version_info < (3 , 12 ):
45+ pytest .skip (
46+ "Skip test because SQLGLot cannot compile model params to JSON at this env."
47+ )
48+
49+ s1 = bpd .Series (["apple" , "bear" ], session = session )
50+ s2 = bpd .Series (["fruit" , "tree" ], session = session )
51+ prompt = (s1 , " is a " , s2 )
52+ model_params = {"generation_config" : {"thinking_config" : {"thinking_budget" : 0 }}}
53+
54+ result = bbq .ai .generate_bool (
55+ prompt , endpoint = "gemini-2.5-flash" , model_params = model_params
56+ ).struct .field ("result" )
57+
58+ pandas .testing .assert_series_equal (
59+ result .to_pandas (),
60+ pd .Series ([True , False ], name = "result" ),
61+ check_dtype = False ,
62+ check_index = False ,
63+ )
You can’t perform that action at this time.
0 commit comments