diff --git a/bigframes/bigquery/_operations/ai.py b/bigframes/bigquery/_operations/ai.py index 8579f7f298..e8c28e61f5 100644 --- a/bigframes/bigquery/_operations/ai.py +++ b/bigframes/bigquery/_operations/ai.py @@ -88,7 +88,7 @@ def generate( or pandas Series. connection_id (str, optional): Specifies the connection to use to communicate with the model. For example, `myproject.us.myconnection`. - If not provided, the connection from the current session will be used. + If not provided, the query uses your end-user credential. endpoint (str, optional): Specifies the Vertex AI endpoint to use for the model. For example `"gemini-2.5-flash"`. You can specify any generally available or preview Gemini model. If you specify the model name, BigQuery ML automatically identifies and @@ -131,7 +131,7 @@ def generate( operator = ai_ops.AIGenerate( prompt_context=tuple(prompt_context), - connection_id=_resolve_connection_id(series_list[0], connection_id), + connection_id=connection_id, endpoint=endpoint, request_type=request_type, model_params=json.dumps(model_params) if model_params else None, @@ -186,7 +186,7 @@ def generate_bool( or pandas Series. connection_id (str, optional): Specifies the connection to use to communicate with the model. For example, `myproject.us.myconnection`. - If not provided, the connection from the current session will be used. + If not provided, the query uses your end-user credential. endpoint (str, optional): Specifies the Vertex AI endpoint to use for the model. For example `"gemini-2.5-flash"`. You can specify any generally available or preview Gemini model. If you specify the model name, BigQuery ML automatically identifies and @@ -216,7 +216,7 @@ def generate_bool( operator = ai_ops.AIGenerateBool( prompt_context=tuple(prompt_context), - connection_id=_resolve_connection_id(series_list[0], connection_id), + connection_id=connection_id, endpoint=endpoint, request_type=request_type, model_params=json.dumps(model_params) if model_params else None, @@ -267,7 +267,7 @@ def generate_int( or pandas Series. connection_id (str, optional): Specifies the connection to use to communicate with the model. For example, `myproject.us.myconnection`. - If not provided, the connection from the current session will be used. + If not provided, the query uses your end-user credential. endpoint (str, optional): Specifies the Vertex AI endpoint to use for the model. For example `"gemini-2.5-flash"`. You can specify any generally available or preview Gemini model. If you specify the model name, BigQuery ML automatically identifies and @@ -297,7 +297,7 @@ def generate_int( operator = ai_ops.AIGenerateInt( prompt_context=tuple(prompt_context), - connection_id=_resolve_connection_id(series_list[0], connection_id), + connection_id=connection_id, endpoint=endpoint, request_type=request_type, model_params=json.dumps(model_params) if model_params else None, @@ -348,7 +348,7 @@ def generate_double( or pandas Series. connection_id (str, optional): Specifies the connection to use to communicate with the model. For example, `myproject.us.myconnection`. - If not provided, the connection from the current session will be used. + If not provided, the query uses your end-user credential. endpoint (str, optional): Specifies the Vertex AI endpoint to use for the model. For example `"gemini-2.5-flash"`. You can specify any generally available or preview Gemini model. If you specify the model name, BigQuery ML automatically identifies and @@ -378,7 +378,7 @@ def generate_double( operator = ai_ops.AIGenerateDouble( prompt_context=tuple(prompt_context), - connection_id=_resolve_connection_id(series_list[0], connection_id), + connection_id=connection_id, endpoint=endpoint, request_type=request_type, model_params=json.dumps(model_params) if model_params else None, diff --git a/bigframes/core/compile/sqlglot/expressions/ai_ops.py b/bigframes/core/compile/sqlglot/expressions/ai_ops.py index e40173d2fd..680e35c511 100644 --- a/bigframes/core/compile/sqlglot/expressions/ai_ops.py +++ b/bigframes/core/compile/sqlglot/expressions/ai_ops.py @@ -104,10 +104,13 @@ def _construct_named_args(op: ops.NaryOp) -> list[sge.Kwarg]: op_args = asdict(op) - connection_id = op_args["connection_id"] - args.append( - sge.Kwarg(this="connection_id", expression=sge.Literal.string(connection_id)) - ) + connection_id = op_args.get("connection_id", None) + if connection_id is not None: + args.append( + sge.Kwarg( + this="connection_id", expression=sge.Literal.string(connection_id) + ) + ) endpoit = op_args.get("endpoint", None) if endpoit is not None: diff --git a/bigframes/operations/ai_ops.py b/bigframes/operations/ai_ops.py index ea65b705e5..8dc8c2ffab 100644 --- a/bigframes/operations/ai_ops.py +++ b/bigframes/operations/ai_ops.py @@ -29,7 +29,7 @@ class AIGenerate(base_ops.NaryOp): name: ClassVar[str] = "ai_generate" prompt_context: Tuple[str | None, ...] - connection_id: str + connection_id: str | None endpoint: str | None request_type: Literal["dedicated", "shared", "unspecified"] model_params: str | None @@ -57,7 +57,7 @@ class AIGenerateBool(base_ops.NaryOp): name: ClassVar[str] = "ai_generate_bool" prompt_context: Tuple[str | None, ...] - connection_id: str + connection_id: str | None endpoint: str | None request_type: Literal["dedicated", "shared", "unspecified"] model_params: str | None @@ -79,7 +79,7 @@ class AIGenerateInt(base_ops.NaryOp): name: ClassVar[str] = "ai_generate_int" prompt_context: Tuple[str | None, ...] - connection_id: str + connection_id: str | None endpoint: str | None request_type: Literal["dedicated", "shared", "unspecified"] model_params: str | None @@ -101,7 +101,7 @@ class AIGenerateDouble(base_ops.NaryOp): name: ClassVar[str] = "ai_generate_double" prompt_context: Tuple[str | None, ...] - connection_id: str + connection_id: str | None endpoint: str | None request_type: Literal["dedicated", "shared", "unspecified"] model_params: str | None diff --git a/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate/out.sql b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate/out.sql index 19f85b181b..ec3515e7ed 100644 --- a/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate/out.sql +++ b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate/out.sql @@ -7,7 +7,6 @@ WITH `bfcte_0` AS ( *, AI.GENERATE( prompt => (`string_col`, ' is the same as ', `string_col`), - connection_id => 'bigframes-dev.us.bigframes-default-connection', endpoint => 'gemini-2.5-flash', request_type => 'SHARED' ) AS `bfcol_1` diff --git a/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_bool/out.sql b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_bool/out.sql index f844ed1691..3a09da7c3a 100644 --- a/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_bool/out.sql +++ b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_bool/out.sql @@ -7,7 +7,6 @@ WITH `bfcte_0` AS ( *, AI.GENERATE_BOOL( prompt => (`string_col`, ' is the same as ', `string_col`), - connection_id => 'bigframes-dev.us.bigframes-default-connection', endpoint => 'gemini-2.5-flash', request_type => 'SHARED' ) AS `bfcol_1` diff --git a/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_bool_with_connection_id/out.sql b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_bool_with_connection_id/out.sql new file mode 100644 index 0000000000..f844ed1691 --- /dev/null +++ b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_bool_with_connection_id/out.sql @@ -0,0 +1,18 @@ +WITH `bfcte_0` AS ( + SELECT + `string_col` + FROM `bigframes-dev`.`sqlglot_test`.`scalar_types` +), `bfcte_1` AS ( + SELECT + *, + AI.GENERATE_BOOL( + prompt => (`string_col`, ' is the same as ', `string_col`), + connection_id => 'bigframes-dev.us.bigframes-default-connection', + endpoint => 'gemini-2.5-flash', + request_type => 'SHARED' + ) AS `bfcol_1` + FROM `bfcte_0` +) +SELECT + `bfcol_1` AS `result` +FROM `bfcte_1` \ No newline at end of file diff --git a/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_bool_with_model_param/out.sql b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_bool_with_model_param/out.sql index 35538c2ec2..2a81ced782 100644 --- a/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_bool_with_model_param/out.sql +++ b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_bool_with_model_param/out.sql @@ -7,7 +7,6 @@ WITH `bfcte_0` AS ( *, AI.GENERATE_BOOL( prompt => (`string_col`, ' is the same as ', `string_col`), - connection_id => 'bigframes-dev.us.bigframes-default-connection', request_type => 'SHARED', model_params => JSON '{}' ) AS `bfcol_1` diff --git a/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_double/out.sql b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_double/out.sql index fae92515cb..3b89429621 100644 --- a/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_double/out.sql +++ b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_double/out.sql @@ -7,7 +7,6 @@ WITH `bfcte_0` AS ( *, AI.GENERATE_DOUBLE( prompt => (`string_col`, ' is the same as ', `string_col`), - connection_id => 'bigframes-dev.us.bigframes-default-connection', endpoint => 'gemini-2.5-flash', request_type => 'SHARED' ) AS `bfcol_1` diff --git a/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_double_with_connection_id/out.sql b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_double_with_connection_id/out.sql new file mode 100644 index 0000000000..fae92515cb --- /dev/null +++ b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_double_with_connection_id/out.sql @@ -0,0 +1,18 @@ +WITH `bfcte_0` AS ( + SELECT + `string_col` + FROM `bigframes-dev`.`sqlglot_test`.`scalar_types` +), `bfcte_1` AS ( + SELECT + *, + AI.GENERATE_DOUBLE( + prompt => (`string_col`, ' is the same as ', `string_col`), + connection_id => 'bigframes-dev.us.bigframes-default-connection', + endpoint => 'gemini-2.5-flash', + request_type => 'SHARED' + ) AS `bfcol_1` + FROM `bfcte_0` +) +SELECT + `bfcol_1` AS `result` +FROM `bfcte_1` \ No newline at end of file diff --git a/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_double_with_model_param/out.sql b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_double_with_model_param/out.sql index f3ddf71014..480ee09ef6 100644 --- a/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_double_with_model_param/out.sql +++ b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_double_with_model_param/out.sql @@ -7,7 +7,6 @@ WITH `bfcte_0` AS ( *, AI.GENERATE_DOUBLE( prompt => (`string_col`, ' is the same as ', `string_col`), - connection_id => 'bigframes-dev.us.bigframes-default-connection', request_type => 'SHARED', model_params => JSON '{}' ) AS `bfcol_1` diff --git a/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_int/out.sql b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_int/out.sql index a0c92c959c..f33af547c7 100644 --- a/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_int/out.sql +++ b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_int/out.sql @@ -7,7 +7,6 @@ WITH `bfcte_0` AS ( *, AI.GENERATE_INT( prompt => (`string_col`, ' is the same as ', `string_col`), - connection_id => 'bigframes-dev.us.bigframes-default-connection', endpoint => 'gemini-2.5-flash', request_type => 'SHARED' ) AS `bfcol_1` diff --git a/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_int_with_connection_id/out.sql b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_int_with_connection_id/out.sql new file mode 100644 index 0000000000..a0c92c959c --- /dev/null +++ b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_int_with_connection_id/out.sql @@ -0,0 +1,18 @@ +WITH `bfcte_0` AS ( + SELECT + `string_col` + FROM `bigframes-dev`.`sqlglot_test`.`scalar_types` +), `bfcte_1` AS ( + SELECT + *, + AI.GENERATE_INT( + prompt => (`string_col`, ' is the same as ', `string_col`), + connection_id => 'bigframes-dev.us.bigframes-default-connection', + endpoint => 'gemini-2.5-flash', + request_type => 'SHARED' + ) AS `bfcol_1` + FROM `bfcte_0` +) +SELECT + `bfcol_1` AS `result` +FROM `bfcte_1` \ No newline at end of file diff --git a/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_int_with_model_param/out.sql b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_int_with_model_param/out.sql index 1951e13325..2929e57ba0 100644 --- a/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_int_with_model_param/out.sql +++ b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_int_with_model_param/out.sql @@ -7,7 +7,6 @@ WITH `bfcte_0` AS ( *, AI.GENERATE_INT( prompt => (`string_col`, ' is the same as ', `string_col`), - connection_id => 'bigframes-dev.us.bigframes-default-connection', request_type => 'SHARED', model_params => JSON '{}' ) AS `bfcol_1` diff --git a/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_with_connection_id/out.sql b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_with_connection_id/out.sql new file mode 100644 index 0000000000..19f85b181b --- /dev/null +++ b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_with_connection_id/out.sql @@ -0,0 +1,18 @@ +WITH `bfcte_0` AS ( + SELECT + `string_col` + FROM `bigframes-dev`.`sqlglot_test`.`scalar_types` +), `bfcte_1` AS ( + SELECT + *, + AI.GENERATE( + prompt => (`string_col`, ' is the same as ', `string_col`), + connection_id => 'bigframes-dev.us.bigframes-default-connection', + endpoint => 'gemini-2.5-flash', + request_type => 'SHARED' + ) AS `bfcol_1` + FROM `bfcte_0` +) +SELECT + `bfcol_1` AS `result` +FROM `bfcte_1` \ No newline at end of file diff --git a/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_with_model_param/out.sql b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_with_model_param/out.sql index 3419a77c61..745243db3a 100644 --- a/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_with_model_param/out.sql +++ b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_with_model_param/out.sql @@ -7,7 +7,6 @@ WITH `bfcte_0` AS ( *, AI.GENERATE( prompt => (`string_col`, ' is the same as ', `string_col`), - connection_id => 'bigframes-dev.us.bigframes-default-connection', request_type => 'SHARED', model_params => JSON '{}' ) AS `bfcol_1` diff --git a/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_with_output_schema/out.sql b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_with_output_schema/out.sql index e1e1670f12..4f7867a0f2 100644 --- a/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_with_output_schema/out.sql +++ b/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_with_output_schema/out.sql @@ -7,7 +7,6 @@ WITH `bfcte_0` AS ( *, AI.GENERATE( prompt => (`string_col`, ' is the same as ', `string_col`), - connection_id => 'bigframes-dev.us.bigframes-default-connection', endpoint => 'gemini-2.5-flash', request_type => 'SHARED', output_schema => 'x INT64, y FLOAT64' diff --git a/tests/unit/core/compile/sqlglot/expressions/test_ai_ops.py b/tests/unit/core/compile/sqlglot/expressions/test_ai_ops.py index 45024fc691..1397c7d6c0 100644 --- a/tests/unit/core/compile/sqlglot/expressions/test_ai_ops.py +++ b/tests/unit/core/compile/sqlglot/expressions/test_ai_ops.py @@ -30,6 +30,25 @@ def test_ai_generate(scalar_types_df: dataframe.DataFrame, snapshot): col_name = "string_col" + op = ops.AIGenerate( + prompt_context=(None, " is the same as ", None), + connection_id=None, + endpoint="gemini-2.5-flash", + request_type="shared", + model_params=None, + output_schema=None, + ) + + sql = utils._apply_ops_to_sql( + scalar_types_df, [op.as_expr(col_name, col_name)], ["result"] + ) + + snapshot.assert_match(sql, "out.sql") + + +def test_ai_generate_with_connection_id(scalar_types_df: dataframe.DataFrame, snapshot): + col_name = "string_col" + op = ops.AIGenerate( prompt_context=(None, " is the same as ", None), connection_id=CONNECTION_ID, @@ -51,7 +70,7 @@ def test_ai_generate_with_output_schema(scalar_types_df: dataframe.DataFrame, sn op = ops.AIGenerate( prompt_context=(None, " is the same as ", None), - connection_id=CONNECTION_ID, + connection_id=None, endpoint="gemini-2.5-flash", request_type="shared", model_params=None, @@ -75,7 +94,7 @@ def test_ai_generate_with_model_param(scalar_types_df: dataframe.DataFrame, snap op = ops.AIGenerate( prompt_context=(None, " is the same as ", None), - connection_id=CONNECTION_ID, + connection_id=None, endpoint=None, request_type="shared", model_params=json.dumps(dict()), @@ -92,6 +111,26 @@ def test_ai_generate_with_model_param(scalar_types_df: dataframe.DataFrame, snap def test_ai_generate_bool(scalar_types_df: dataframe.DataFrame, snapshot): col_name = "string_col" + op = ops.AIGenerateBool( + prompt_context=(None, " is the same as ", None), + connection_id=None, + endpoint="gemini-2.5-flash", + request_type="shared", + model_params=None, + ) + + sql = utils._apply_ops_to_sql( + scalar_types_df, [op.as_expr(col_name, col_name)], ["result"] + ) + + snapshot.assert_match(sql, "out.sql") + + +def test_ai_generate_bool_with_connection_id( + scalar_types_df: dataframe.DataFrame, snapshot +): + col_name = "string_col" + op = ops.AIGenerateBool( prompt_context=(None, " is the same as ", None), connection_id=CONNECTION_ID, @@ -119,7 +158,7 @@ def test_ai_generate_bool_with_model_param( op = ops.AIGenerateBool( prompt_context=(None, " is the same as ", None), - connection_id=CONNECTION_ID, + connection_id=None, endpoint=None, request_type="shared", model_params=json.dumps(dict()), @@ -135,6 +174,27 @@ def test_ai_generate_bool_with_model_param( def test_ai_generate_int(scalar_types_df: dataframe.DataFrame, snapshot): col_name = "string_col" + op = ops.AIGenerateInt( + # The prompt does not make semantic sense but we only care about syntax correctness. + prompt_context=(None, " is the same as ", None), + connection_id=None, + endpoint="gemini-2.5-flash", + request_type="shared", + model_params=None, + ) + + sql = utils._apply_ops_to_sql( + scalar_types_df, [op.as_expr(col_name, col_name)], ["result"] + ) + + snapshot.assert_match(sql, "out.sql") + + +def test_ai_generate_int_with_connection_id( + scalar_types_df: dataframe.DataFrame, snapshot +): + col_name = "string_col" + op = ops.AIGenerateInt( # The prompt does not make semantic sense but we only care about syntax correctness. prompt_context=(None, " is the same as ", None), @@ -164,7 +224,7 @@ def test_ai_generate_int_with_model_param( op = ops.AIGenerateInt( # The prompt does not make semantic sense but we only care about syntax correctness. prompt_context=(None, " is the same as ", None), - connection_id=CONNECTION_ID, + connection_id=None, endpoint=None, request_type="shared", model_params=json.dumps(dict()), @@ -180,6 +240,27 @@ def test_ai_generate_int_with_model_param( def test_ai_generate_double(scalar_types_df: dataframe.DataFrame, snapshot): col_name = "string_col" + op = ops.AIGenerateDouble( + # The prompt does not make semantic sense but we only care about syntax correctness. + prompt_context=(None, " is the same as ", None), + connection_id=None, + endpoint="gemini-2.5-flash", + request_type="shared", + model_params=None, + ) + + sql = utils._apply_ops_to_sql( + scalar_types_df, [op.as_expr(col_name, col_name)], ["result"] + ) + + snapshot.assert_match(sql, "out.sql") + + +def test_ai_generate_double_with_connection_id( + scalar_types_df: dataframe.DataFrame, snapshot +): + col_name = "string_col" + op = ops.AIGenerateDouble( # The prompt does not make semantic sense but we only care about syntax correctness. prompt_context=(None, " is the same as ", None), @@ -209,7 +290,7 @@ def test_ai_generate_double_with_model_param( op = ops.AIGenerateDouble( # The prompt does not make semantic sense but we only care about syntax correctness. prompt_context=(None, " is the same as ", None), - connection_id=CONNECTION_ID, + connection_id=None, endpoint=None, request_type="shared", model_params=json.dumps(dict()), diff --git a/third_party/bigframes_vendored/ibis/expr/operations/ai_ops.py b/third_party/bigframes_vendored/ibis/expr/operations/ai_ops.py index da7f132de3..ef387d3379 100644 --- a/third_party/bigframes_vendored/ibis/expr/operations/ai_ops.py +++ b/third_party/bigframes_vendored/ibis/expr/operations/ai_ops.py @@ -21,7 +21,7 @@ class AIGenerate(Value): """Generate content based on the prompt""" prompt: Value - connection_id: Value[dt.String] + connection_id: Optional[Value[dt.String]] endpoint: Optional[Value[dt.String]] request_type: Value[dt.String] model_params: Optional[Value[dt.String]] @@ -52,7 +52,7 @@ class AIGenerateBool(Value): """Generate Bool based on the prompt""" prompt: Value - connection_id: Value[dt.String] + connection_id: Optional[Value[dt.String]] endpoint: Optional[Value[dt.String]] request_type: Value[dt.String] model_params: Optional[Value[dt.String]] @@ -71,7 +71,7 @@ class AIGenerateInt(Value): """Generate integers based on the prompt""" prompt: Value - connection_id: Value[dt.String] + connection_id: Optional[Value[dt.String]] endpoint: Optional[Value[dt.String]] request_type: Value[dt.String] model_params: Optional[Value[dt.String]] @@ -90,7 +90,7 @@ class AIGenerateDouble(Value): """Generate doubles based on the prompt""" prompt: Value - connection_id: Value[dt.String] + connection_id: Optional[Value[dt.String]] endpoint: Optional[Value[dt.String]] request_type: Value[dt.String] model_params: Optional[Value[dt.String]]