@@ -57,7 +57,7 @@ def agg(
57
57
>>> bpd.options.compute.semantic_ops_confirmation_threshold = 25
58
58
59
59
>>> import bigframes.ml.llm as llm
60
- >>> model = llm.GeminiTextGenerator(model_name="gemini-2.0-flash-001")
60
+ >>> model = llm.GeminiTextGenerator(model_name="gemini-2.0-flash-001") # doctest: +SKIP
61
61
62
62
>>> df = bpd.DataFrame(
63
63
... {
@@ -68,7 +68,7 @@ def agg(
68
68
... ],
69
69
... "Year": [1997, 2013, 2010],
70
70
... })
71
- >>> df.semantics.agg(
71
+ >>> df.semantics.agg( # doctest: +SKIP
72
72
... "Find the first name shared by all actors in {Movies}. One word answer.",
73
73
... model=model,
74
74
... )
@@ -326,10 +326,10 @@ def filter(self, instruction: str, model, ground_with_google_search: bool = Fals
326
326
>>> bpd.options.compute.semantic_ops_confirmation_threshold = 25
327
327
328
328
>>> import bigframes.ml.llm as llm
329
- >>> model = llm.GeminiTextGenerator(model_name="gemini-2.0-flash-001")
329
+ >>> model = llm.GeminiTextGenerator(model_name="gemini-2.0-flash-001") # doctest: +SKIP
330
330
331
331
>>> df = bpd.DataFrame({"country": ["USA", "Germany"], "city": ["Seattle", "Berlin"]})
332
- >>> df.semantics.filter("{city} is the capital of {country}", model)
332
+ >>> df.semantics.filter("{city} is the capital of {country}", model) # doctest: +SKIP
333
333
country city
334
334
1 Germany Berlin
335
335
<BLANKLINE>
@@ -440,10 +440,10 @@ def map(
440
440
>>> bpd.options.compute.semantic_ops_confirmation_threshold = 25
441
441
442
442
>>> import bigframes.ml.llm as llm
443
- >>> model = llm.GeminiTextGenerator(model_name="gemini-2.0-flash-001")
443
+ >>> model = llm.GeminiTextGenerator(model_name="gemini-2.0-flash-001") # doctest: +SKIP
444
444
445
445
>>> df = bpd.DataFrame({"ingredient_1": ["Burger Bun", "Soy Bean"], "ingredient_2": ["Beef Patty", "Bittern"]})
446
- >>> df.semantics.map("What is the food made from {ingredient_1} and {ingredient_2}? One word only.", output_column="food", model=model)
446
+ >>> df.semantics.map("What is the food made from {ingredient_1} and {ingredient_2}? One word only.", output_column="food", model=model) # doctest: +SKIP
447
447
ingredient_1 ingredient_2 food
448
448
0 Burger Bun Beef Patty Burger
449
449
<BLANKLINE>
@@ -563,12 +563,12 @@ def join(
563
563
>>> bpd.options.compute.semantic_ops_confirmation_threshold = 25
564
564
565
565
>>> import bigframes.ml.llm as llm
566
- >>> model = llm.GeminiTextGenerator(model_name="gemini-2.0-flash-001")
566
+ >>> model = llm.GeminiTextGenerator(model_name="gemini-2.0-flash-001") # doctest: +SKIP
567
567
568
568
>>> cities = bpd.DataFrame({'city': ['Seattle', 'Ottawa', 'Berlin', 'Shanghai', 'New Delhi']})
569
569
>>> continents = bpd.DataFrame({'continent': ['North America', 'Africa', 'Asia']})
570
570
571
- >>> cities.semantics.join(continents, "{city} is in {continent}", model)
571
+ >>> cities.semantics.join(continents, "{city} is in {continent}", model) # doctest: +SKIP
572
572
city continent
573
573
0 Seattle North America
574
574
1 Ottawa North America
@@ -704,10 +704,10 @@ def search(
704
704
>>> bpd.options.compute.semantic_ops_confirmation_threshold = 25
705
705
706
706
>>> import bigframes.ml.llm as llm
707
- >>> model = llm.TextEmbeddingGenerator(model_name="text-embedding-005")
707
+ >>> model = llm.TextEmbeddingGenerator(model_name="text-embedding-005") # doctest: +SKIP
708
708
709
709
>>> df = bpd.DataFrame({"creatures": ["salmon", "sea urchin", "frog", "chimpanzee"]})
710
- >>> df.semantics.search("creatures", "monkey", top_k=1, model=model, score_column='distance')
710
+ >>> df.semantics.search("creatures", "monkey", top_k=1, model=model, score_column='distance') # doctest: +SKIP
711
711
creatures distance
712
712
3 chimpanzee 0.635844
713
713
<BLANKLINE>
@@ -805,14 +805,14 @@ def top_k(
805
805
>>> bpd.options.compute.semantic_ops_confirmation_threshold = 25
806
806
807
807
>>> import bigframes.ml.llm as llm
808
- >>> model = llm.GeminiTextGenerator(model_name="gemini-2.0-flash-001")
808
+ >>> model = llm.GeminiTextGenerator(model_name="gemini-2.0-flash-001") # doctest: +SKIP
809
809
810
810
>>> df = bpd.DataFrame(
811
811
... {
812
812
... "Animals": ["Dog", "Bird", "Cat", "Horse"],
813
813
... "Sounds": ["Woof", "Chirp", "Meow", "Neigh"],
814
814
... })
815
- >>> df.semantics.top_k("{Animals} are more popular as pets", model=model, k=2)
815
+ >>> df.semantics.top_k("{Animals} are more popular as pets", model=model, k=2) # doctest: +SKIP
816
816
Animals Sounds
817
817
0 Dog Woof
818
818
2 Cat Meow
@@ -1006,12 +1006,12 @@ def sim_join(
1006
1006
>>> bpd.options.compute.semantic_ops_confirmation_threshold = 25
1007
1007
1008
1008
>>> import bigframes.ml.llm as llm
1009
- >>> model = llm.TextEmbeddingGenerator(model_name="text-embedding-005")
1009
+ >>> model = llm.TextEmbeddingGenerator(model_name="text-embedding-005") # doctest: +SKIP
1010
1010
1011
1011
>>> df1 = bpd.DataFrame({'animal': ['monkey', 'spider']})
1012
1012
>>> df2 = bpd.DataFrame({'animal': ['scorpion', 'baboon']})
1013
1013
1014
- >>> df1.semantics.sim_join(df2, left_on='animal', right_on='animal', model=model, top_k=1)
1014
+ >>> df1.semantics.sim_join(df2, left_on='animal', right_on='animal', model=model, top_k=1) # doctest: +SKIP
1015
1015
animal animal_1
1016
1016
0 monkey baboon
1017
1017
1 spider scorpion
0 commit comments