@@ -61,7 +61,7 @@ def generate(
6161 >>> import bigframes.pandas as bpd
6262 >>> import bigframes.bigquery as bbq
6363 >>> country = bpd.Series(["Japan", "Canada"])
64- >>> bbq.ai.generate(("What's the capital city of ", country, " one word only"))
64+ >>> bbq.ai.generate(("What's the capital city of ", country, " one word only")) # doctest: +ELLIPSIS
6565 0 {'result': 'Tokyo', 'full_response': '{"cand...
6666 1 {'result': 'Ottawa', 'full_response': '{"can...
6767 dtype: struct<result: string, full_response: extension<dbjson<JSONArrowType>>, status: string>[pyarrow]
@@ -231,8 +231,8 @@ def generate_int(
231231
232232 >>> import bigframes.pandas as bpd
233233 >>> import bigframes.bigquery as bbq
234- >>> animal = bpd.Series(["Kangaroo ", "Rabbit", "Spider"])
235- >>> bbq.ai.generate_int(("How many legs does a ", animal, " have?"))
234+ >>> animal = bpd.Series(["Ostrich ", "Rabbit", "Spider"])
235+ >>> bbq.ai.generate_int(("How many legs does a ", animal, " have?")) # doctest: +ELLIPSIS
236236 0 {'result': 2, 'full_response': '{"candidates":...
237237 1 {'result': 4, 'full_response': '{"candidates":...
238238 2 {'result': 8, 'full_response': '{"candidates":...
@@ -305,8 +305,8 @@ def generate_double(
305305
306306 >>> import bigframes.pandas as bpd
307307 >>> import bigframes.bigquery as bbq
308- >>> animal = bpd.Series(["Kangaroo ", "Rabbit", "Spider"])
309- >>> bbq.ai.generate_double(("How many legs does a ", animal, " have?"))
308+ >>> animal = bpd.Series(["Ostrich ", "Rabbit", "Spider"])
309+ >>> bbq.ai.generate_double(("How many legs does a ", animal, " have?")) # doctest: +ELLIPSIS
310310 0 {'result': 2.0, 'full_response': '{"candidates...
311311 1 {'result': 4.0, 'full_response': '{"candidates...
312312 2 {'result': 8.0, 'full_response': '{"candidates...
@@ -383,7 +383,7 @@ def generate_embedding(
383383 >>> import bigframes.pandas as bpd
384384 >>> import bigframes.bigquery as bbq
385385 >>> df = bpd.DataFrame({"content": ["apple", "bear", "pear"]})
386- >>> bbq.ai.generate_embedding(
386+ >>> bbq.ai.generate_embedding( # doctest: +SKIP
387387 ... "project.dataset.model_name",
388388 ... df
389389 ... )
@@ -486,7 +486,7 @@ def generate_text(
486486 >>> import bigframes.pandas as bpd
487487 >>> import bigframes.bigquery as bbq
488488 >>> df = bpd.DataFrame({"prompt": ["write a poem about apples"]})
489- >>> bbq.ai.generate_text(
489+ >>> bbq.ai.generate_text( # doctest: +SKIP
490490 ... "project.dataset.model_name",
491491 ... df
492492 ... )
@@ -601,7 +601,7 @@ def generate_table(
601601 >>> # the necessary columns for the model's prompt. For example, a
602602 >>> # DataFrame with a 'prompt' column for text classification.
603603 >>> df = bpd.DataFrame({'prompt': ["some text to classify"]})
604- >>> result = bbq.ai.generate_table(
604+ >>> result = bbq.ai.generate_table( # doctest: +SKIP
605605 ... "project.dataset.model_name",
606606 ... data=df,
607607 ... output_schema="category STRING"
@@ -708,12 +708,14 @@ def embed(
708708
709709 >>> import bigframes.pandas as bpd
710710 >>> import bigframes.bigquery as bbq
711- >>> bbq.ai.embed("dog", endpoint="text-embedding-005")
711+ >>> bbq.ai.embed("dog", endpoint="text-embedding-005") # doctest: +ELLIPSIS
712712 0 {'result': array([ 1.78243860e-03, -1.10658340...
713+ dtype: struct<result: list<item: double>, status: string>[pyarrow]
713714
714715 >>> s = bpd.Series(['dog'])
715- >>> bbq.ai.embed(s, endpoint='text-embedding-005')
716+ >>> bbq.ai.embed(s, endpoint='text-embedding-005') # doctest: +ELLIPSIS
716717 0 {'result': array([ 1.78243860e-03, -1.10658340...
718+ dtype: struct<result: list<item: double>, status: string>[pyarrow]
717719
718720 Args:
719721 content (str | Series):
@@ -1004,6 +1006,7 @@ def similarity(
10041006 >>> bbq.ai.similarity(df['word'], 'glad', endpoint='text-embedding-005')
10051007 0 0.916601
10061008 1 0.660579
1009+ Name: word, dtype: Float64
10071010
10081011 Args:
10091012 content1 (str | Series):
@@ -1082,8 +1085,8 @@ def forecast(
10821085 >>> df = pd.DataFrame({"value": [1, 2, 3], "time": pd.to_datetime(["2020-01-01", "2020-01-02", "2020-01-03"])})
10831086 >>> bpd.options.display.progress_bar = None
10841087 >>> forecasted_pandas_df = df.bigquery.ai.forecast(data_col="value", timestamp_col="time", horizon=2)
1085- >>> type(forecasted_pandas_df)
1086- <class 'pandas.core.frame .DataFrame'>
1088+ >>> type(forecasted_pandas_df) # doctest: +ELLIPSIS
1089+ <class 'pandas.. .DataFrame'>
10871090
10881091 Forecast using a BigFrames DataFrame:
10891092
0 commit comments