@@ -59,7 +59,6 @@ def llm_gateway_generate_text_col(
5959 template : str ,
6060 values : Union [Dict [str , "Column" ], "Column" ],
6161 model_id : Optional [str ] = None ,
62- max_tokens : Optional [int ] = None ,
6362) -> "Column" :
6463 """Build a Spark Column that runs the LLM Gateway per row.
6564
@@ -71,7 +70,6 @@ def llm_gateway_generate_text_col(
7170 ... "In one sentence, greet {name} from {city}.",
7271 ... {"name": col("name__c"), "city": col("homecity__c")},
7372 ... model_id="sfdc_ai__DefaultGPT4Omni",
74- ... max_tokens=100,
7573 ... ),
7674 ... )
7775
@@ -81,15 +79,12 @@ def llm_gateway_generate_text_col(
8179 values: Either a mapping from placeholder name to Spark ``Column``, or
8280 a single ``Column`` whose value is already a struct.
8381 model_id: LLM model id. Defaults to ``sfdc_ai__DefaultGPT4Omni``.
84- max_tokens: Maximum tokens to generate. Defaults to 200.
8582
8683 Returns:
8784 A Spark ``Column`` that, when evaluated, produces the generated text.
8885 """
8986 gateway = Client ()._get_spark_llm_gateway ()
90- return gateway .llm_gateway_generate_text_col (
91- template , values , model_id = model_id , max_tokens = max_tokens
92- )
87+ return gateway .llm_gateway_generate_text_col (template , values , model_id = model_id )
9388
9489
9590class DataCloudObjectType (Enum ):
@@ -150,9 +145,7 @@ class Client:
150145 finder: Find a file path
151146 reader: A custom reader to use for reading Data Cloud objects.
152147 writer: A custom writer to use for writing Data Cloud objects.
153- spark_llm_gateway: Optional custom :class:`SparkLLMGateway`. When
154- omitted, the gateway is lazily resolved from
155- ``spark_llm_gateway_config``.
148+ spark_llm_gateway: Optional custom :class:`SparkLLMGateway`.
156149
157150 Example:
158151 >>> client = Client()
@@ -292,7 +285,6 @@ def llm_gateway_generate_text(
292285 self ,
293286 prompt : str ,
294287 model_id : Optional [str ] = None ,
295- max_tokens : Optional [int ] = None ,
296288 ) -> str :
297289 """Issue a one-shot LLM Gateway call. This is the scalar counterpart to
298290 :func:`llm_gateway_generate_text_col`: it runs **once** — not per row.
@@ -310,15 +302,13 @@ def llm_gateway_generate_text(
310302 ``{field}`` substitution is performed on this string.
311303 model_id: LLM model id to target. Defaults to
312304 ``sfdc_ai__DefaultGPT4Omni`` when ``None``.
313- max_tokens: Hard upper bound on the number of tokens the model
314- may generate. Defaults to 200 when ``None``.
315305
316306 Returns:
317307 The generated text as a plain Python ``str``; empty when the
318308 gateway response carries no generated text.
319309 """
320310 return self ._get_spark_llm_gateway ().llm_gateway_generate_text (
321- prompt , model_id = model_id , max_tokens = max_tokens
311+ prompt , model_id = model_id
322312 )
323313
324314 def _get_spark_llm_gateway (self ) -> SparkLLMGateway :
0 commit comments