Skip to content
Merged
Changes from all 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
10 changes: 5 additions & 5 deletions packages/bigframes/bigframes/operations/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def filter(
>>> bpd.options.compute.ai_ops_confirmation_threshold = 25

>>> import bigframes.ml.llm as llm
>>> model = llm.GeminiTextGenerator(model_name="gemini-2.0-flash-001")
>>> model = llm.GeminiTextGenerator(model_name="gemini-2.5-pro")

>>> df = bpd.DataFrame({"country": ["USA", "Germany"], "city": ["Seattle", "Berlin"]})
>>> df.ai.filter("{city} is the capital of {country}", model)
Expand Down Expand Up @@ -119,7 +119,7 @@ def map(
>>> bpd.options.compute.ai_ops_confirmation_threshold = 25

>>> import bigframes.ml.llm as llm
>>> model = llm.GeminiTextGenerator(model_name="gemini-2.0-flash-001")
>>> model = llm.GeminiTextGenerator(model_name="gemini-2.5-pro")

>>> df = bpd.DataFrame({"ingredient_1": ["Burger Bun", "Soy Bean"], "ingredient_2": ["Beef Patty", "Bittern"]})
>>> df.ai.map("What is the food made from {ingredient_1} and {ingredient_2}? One word only.", model=model, output_schema={"food": "string"})
Expand All @@ -137,7 +137,7 @@ def map(
>>> bpd.options.compute.ai_ops_confirmation_threshold = 25

>>> import bigframes.ml.llm as llm
>>> model = llm.GeminiTextGenerator(model_name="gemini-2.0-flash-001")
>>> model = llm.GeminiTextGenerator(model_name="gemini-2.5-pro")

>>> df = bpd.DataFrame({"text": ["Elmo lives at 123 Sesame Street."]})
>>> df.ai.map("{text}", model=model, output_schema={"person": "string", "address": "string"})
Expand Down Expand Up @@ -268,7 +268,7 @@ def classify(
>>> bpd.options.compute.ai_ops_confirmation_threshold = 25

>>> import bigframes.ml.llm as llm
>>> model = llm.GeminiTextGenerator(model_name="gemini-2.0-flash-001")
>>> model = llm.GeminiTextGenerator(model_name="gemini-2.5-pro")

>>> df = bpd.DataFrame({
... "feedback_text": [
Expand Down Expand Up @@ -357,7 +357,7 @@ def join(
>>> bpd.options.compute.ai_ops_confirmation_threshold = 25

>>> import bigframes.ml.llm as llm
>>> model = llm.GeminiTextGenerator(model_name="gemini-2.0-flash-001")
>>> model = llm.GeminiTextGenerator(model_name="gemini-2.5-pro")

>>> cities = bpd.DataFrame({'city': ['Seattle', 'Ottawa', 'Berlin', 'Shanghai', 'New Delhi']})
>>> continents = bpd.DataFrame({'continent': ['North America', 'Africa', 'Asia']})
Expand Down
Loading