spark-nlp 6.1.4__py2.py3-none-any.whl → 6.1.5__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of spark-nlp might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: spark-nlp
3
- Version: 6.1.4
3
+ Version: 6.1.5
4
4
  Summary: John Snow Labs Spark NLP is a natural language processing library built on top of Apache Spark ML. It provides simple, performant & accurate NLP annotations for machine learning pipelines, that scale easily in a distributed environment.
5
5
  Home-page: https://github.com/JohnSnowLabs/spark-nlp
6
6
  Author: John Snow Labs
@@ -102,7 +102,7 @@ $ java -version
102
102
  $ conda create -n sparknlp python=3.7 -y
103
103
  $ conda activate sparknlp
104
104
  # spark-nlp by default is based on pyspark 3.x
105
- $ pip install spark-nlp==6.1.4 pyspark==3.3.1
105
+ $ pip install spark-nlp==6.1.5 pyspark==3.3.1
106
106
  ```
107
107
 
108
108
  In Python console or Jupyter `Python3` kernel:
@@ -168,7 +168,7 @@ For a quick example of using pipelines and models take a look at our official [d
168
168
 
169
169
  ### Apache Spark Support
170
170
 
171
- Spark NLP *6.1.4* has been built on top of Apache Spark 3.4 while fully supports Apache Spark 3.0.x, 3.1.x, 3.2.x, 3.3.x, 3.4.x, and 3.5.x
171
+ Spark NLP *6.1.5* has been built on top of Apache Spark 3.4 while fully supports Apache Spark 3.0.x, 3.1.x, 3.2.x, 3.3.x, 3.4.x, and 3.5.x
172
172
 
173
173
  | Spark NLP | Apache Spark 3.5.x | Apache Spark 3.4.x | Apache Spark 3.3.x | Apache Spark 3.2.x | Apache Spark 3.1.x | Apache Spark 3.0.x | Apache Spark 2.4.x | Apache Spark 2.3.x |
174
174
  |-----------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
@@ -198,7 +198,7 @@ Find out more about 4.x `SparkNLP` versions in our official [documentation](http
198
198
 
199
199
  ### Databricks Support
200
200
 
201
- Spark NLP 6.1.4 has been tested and is compatible with the following runtimes:
201
+ Spark NLP 6.1.5 has been tested and is compatible with the following runtimes:
202
202
 
203
203
  | **CPU** | **GPU** |
204
204
  |--------------------|--------------------|
@@ -216,7 +216,7 @@ We are compatible with older runtimes. For a full list check databricks support
216
216
 
217
217
  ### EMR Support
218
218
 
219
- Spark NLP 6.1.4 has been tested and is compatible with the following EMR releases:
219
+ Spark NLP 6.1.5 has been tested and is compatible with the following EMR releases:
220
220
 
221
221
  | **EMR Release** |
222
222
  |--------------------|
@@ -3,7 +3,7 @@ com/johnsnowlabs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
3
3
  com/johnsnowlabs/ml/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  com/johnsnowlabs/ml/ai/__init__.py,sha256=YQiK2M7U4d8y5irPy_HB8ae0mSpqS9583MH44pnKJXc,295
5
5
  com/johnsnowlabs/nlp/__init__.py,sha256=DPIVXtONO5xXyOk-HB0-sNiHAcco17NN13zPS_6Uw8c,294
6
- sparknlp/__init__.py,sha256=LcfC7bWeae5XgjWbNbWH94LlJkBon5dA8fYnb_2NyGc,13814
6
+ sparknlp/__init__.py,sha256=DDZfgU_lB6Bzk_7AAy81w1hkRwYlrOerC4dP-hQFpm8,13814
7
7
  sparknlp/annotation.py,sha256=I5zOxG5vV2RfPZfqN9enT1i4mo6oBcn3Lrzs37QiOiA,5635
8
8
  sparknlp/annotation_audio.py,sha256=iRV_InSVhgvAwSRe9NTbUH9v6OGvTM-FPCpSAKVu0mE,1917
9
9
  sparknlp/annotation_image.py,sha256=xhCe8Ko-77XqWVuuYHFrjKqF6zPd8Z-RY_rmZXNwCXU,2547
@@ -241,7 +241,7 @@ sparknlp/logging/__init__.py,sha256=DoROFF5KLZe4t4Q-OHxqk1nhqbw9NQ-wb64y8icNwgw,
241
241
  sparknlp/logging/comet.py,sha256=_ZBi9-hlilCAnd4lvdYMWiq4Vqsppv8kow3k0cf-NG4,15958
242
242
  sparknlp/partition/__init__.py,sha256=L0w-yv_HnnvoKlSX5MzI2GKHW3RLLfGyq8bgWYVeKjU,749
243
243
  sparknlp/partition/partition.py,sha256=GXEAUvOea04Vc_JK0z112cAKFrJ4AEpjLJ8xlzZt6Kw,8551
244
- sparknlp/partition/partition_properties.py,sha256=2tGdIv1NaJNaux_TTskKQHnARAwBkFctaqCcNw21Wr8,19920
244
+ sparknlp/partition/partition_properties.py,sha256=QPqh5p3gvBSofZpPbyd18Zchvls0QP3S9Rsiy9Vko34,21862
245
245
  sparknlp/partition/partition_transformer.py,sha256=lRR1h-IMlHR8M0VeB50SbU39GHHF5PgMaJ42qOriS6A,6855
246
246
  sparknlp/pretrained/__init__.py,sha256=GV-x9UBK8F2_IR6zYatrzFcVJtkSUIMbxqWsxRUePmQ,793
247
247
  sparknlp/pretrained/pretrained_pipeline.py,sha256=lquxiaABuA68Rmu7csamJPqBoRJqMUO0oNHsmEZDAIs,5740
@@ -250,9 +250,10 @@ sparknlp/pretrained/utils.py,sha256=T1MrvW_DaWk_jcOjVLOea0NMFE9w8fe0ZT_5urZ_nEY,
250
250
  sparknlp/reader/__init__.py,sha256=-Toj3AIBki-zXPpV8ezFTI2LX1yP_rK2bhpoa8nBkTw,685
251
251
  sparknlp/reader/enums.py,sha256=MNGug9oJ1BBLM1Pbske13kAabalDzHa2kucF5xzFpHs,770
252
252
  sparknlp/reader/pdf_to_text.py,sha256=eWw-cwjosmcSZ9eHso0F5QQoeGBBnwsOhzhCXXvMjZA,7169
253
- sparknlp/reader/reader2doc.py,sha256=87aMk8-_1NHd3bB1rxw56BQMJc6mGgtnYGXwKw2uCmU,5916
253
+ sparknlp/reader/reader2doc.py,sha256=lQHwxUwrBOScDryNpQJAdyXIqCDIHEt4-kDf-17ZZds,4287
254
254
  sparknlp/reader/reader2image.py,sha256=k3gb4LEiqDV-pnD-HEaA1KHoAxXmoYys2Y817i1yvP0,4557
255
- sparknlp/reader/reader2table.py,sha256=pIR9r6NapUV4xdsFecadWlKTSJmRMAm36eqM9aXf13k,2416
255
+ sparknlp/reader/reader2table.py,sha256=VINfUzi_tdZN3tCjLmhF9CQjHKUhVYTzBBSRSnTXlr8,1370
256
+ sparknlp/reader/reader_assembler.py,sha256=AgkA3BaZ_00Eor4D84lZLxx04n2pDE_uatO535RAs9M,5655
256
257
  sparknlp/reader/sparknlp_reader.py,sha256=MJs8v_ECYaV1SOabI1L_2MkVYEDVImtwgbYypO7DJSY,20623
257
258
  sparknlp/training/__init__.py,sha256=qREi9u-5Vc2VjpL6-XZsyvu5jSEIdIhowW7_kKaqMqo,852
258
259
  sparknlp/training/conll.py,sha256=wKBiSTrjc6mjsl7Nyt6B8f4yXsDJkZb-sn8iOjix9cE,6961
@@ -284,7 +285,7 @@ sparknlp/training/_tf_graph_builders_1x/ner_dl/dataset_encoder.py,sha256=R4yHFN3
284
285
  sparknlp/training/_tf_graph_builders_1x/ner_dl/ner_model.py,sha256=EoCSdcIjqQ3wv13MAuuWrKV8wyVBP0SbOEW41omHlR0,23189
285
286
  sparknlp/training/_tf_graph_builders_1x/ner_dl/ner_model_saver.py,sha256=k5CQ7gKV6HZbZMB8cKLUJuZxoZWlP_DFWdZ--aIDwsc,2356
286
287
  sparknlp/training/_tf_graph_builders_1x/ner_dl/sentence_grouper.py,sha256=pAxjWhjazSX8Vg0MFqJiuRVw1IbnQNSs-8Xp26L4nko,870
287
- spark_nlp-6.1.4.dist-info/METADATA,sha256=CqRyNEZCA_8F_J5vHG4GUZXRiavXyfb3tPMTStidr4c,19774
288
- spark_nlp-6.1.4.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
289
- spark_nlp-6.1.4.dist-info/top_level.txt,sha256=uuytur4pyMRw2H_txNY2ZkaucZHUs22QF8-R03ch_-E,13
290
- spark_nlp-6.1.4.dist-info/RECORD,,
288
+ spark_nlp-6.1.5.dist-info/METADATA,sha256=0eZlMGP1ltriZNLI0gw5Amp2ByB_TJyLqTZza9E2pxY,19774
289
+ spark_nlp-6.1.5.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
290
+ spark_nlp-6.1.5.dist-info/top_level.txt,sha256=uuytur4pyMRw2H_txNY2ZkaucZHUs22QF8-R03ch_-E,13
291
+ spark_nlp-6.1.5.dist-info/RECORD,,
sparknlp/__init__.py CHANGED
@@ -66,7 +66,7 @@ sys.modules['com.johnsnowlabs.ml.ai'] = annotator
66
66
  annotators = annotator
67
67
  embeddings = annotator
68
68
 
69
- __version__ = "6.1.4"
69
+ __version__ = "6.1.5"
70
70
 
71
71
 
72
72
  def start(gpu=False,
@@ -18,6 +18,23 @@ from pyspark.ml.param import Param, Params, TypeConverters
18
18
 
19
19
  class HasReaderProperties(Params):
20
20
 
21
+ inputCol = Param(
22
+ Params._dummy(),
23
+ "inputCol",
24
+ "input column name",
25
+ typeConverter=TypeConverters.toString
26
+ )
27
+
28
+ def setInputCol(self, value):
29
+ """Sets input column name.
30
+
31
+ Parameters
32
+ ----------
33
+ value : str
34
+ Name of the Input Column
35
+ """
36
+ return self._set(inputCol=value)
37
+
21
38
  outputCol = Param(
22
39
  Params._dummy(),
23
40
  "outputCol",
@@ -25,6 +42,16 @@ class HasReaderProperties(Params):
25
42
  typeConverter=TypeConverters.toString
26
43
  )
27
44
 
45
+ def setOutputCol(self, value):
46
+ """Sets output column name.
47
+
48
+ Parameters
49
+ ----------
50
+ value : str
51
+ Name of the Output Column
52
+ """
53
+ return self._set(outputCol=value)
54
+
28
55
  contentPath = Param(
29
56
  Params._dummy(),
30
57
  "contentPath",
@@ -167,6 +194,56 @@ class HasReaderProperties(Params):
167
194
  """
168
195
  return self._set(explodeDocs=value)
169
196
 
197
+ flattenOutput = Param(
198
+ Params._dummy(),
199
+ "flattenOutput",
200
+ "If true, output is flattened to plain text with minimal metadata",
201
+ typeConverter=TypeConverters.toBoolean
202
+ )
203
+
204
+ def setFlattenOutput(self, value):
205
+ """Sets whether to flatten the output to plain text with minimal metadata.
206
+
207
+ ParametersF
208
+ ----------
209
+ value : bool
210
+ If true, output is flattened to plain text with minimal metadata
211
+ """
212
+ return self._set(flattenOutput=value)
213
+
214
+ titleThreshold = Param(
215
+ Params._dummy(),
216
+ "titleThreshold",
217
+ "Minimum font size threshold for title detection in PDF docs",
218
+ typeConverter=TypeConverters.toFloat
219
+ )
220
+
221
+ def setTitleThreshold(self, value):
222
+ """Sets the minimum font size threshold for title detection in PDF documents.
223
+
224
+ Parameters
225
+ ----------
226
+ value : float
227
+ Minimum font size threshold for title detection in PDF docs
228
+ """
229
+ return self._set(titleThreshold=value)
230
+
231
+ outputAsDocument = Param(
232
+ Params._dummy(),
233
+ "outputAsDocument",
234
+ "Whether to return all sentences joined into a single document",
235
+ typeConverter=TypeConverters.toBoolean
236
+ )
237
+
238
+ def setOutputAsDocument(self, value):
239
+ """Sets whether to return all sentences joined into a single document.
240
+
241
+ Parameters
242
+ ----------
243
+ value : bool
244
+ Whether to return all sentences joined into a single document
245
+ """
246
+ return self._set(outputAsDocument=value)
170
247
 
171
248
  class HasEmailReaderProperties(Params):
172
249
 
@@ -683,13 +760,3 @@ class HasPdfProperties(Params):
683
760
  True to read as images, False otherwise.
684
761
  """
685
762
  return self._set(readAsImage=value)
686
-
687
- def setOutputCol(self, value):
688
- """Sets output column name.
689
-
690
- Parameters
691
- ----------
692
- value : str
693
- Name of the Output Column
694
- """
695
- return self._set(outputCol=value)
@@ -12,7 +12,6 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
  from pyspark import keyword_only
15
- from pyspark.ml.param import TypeConverters, Params, Param
16
15
 
17
16
  from sparknlp.common import AnnotatorType
18
17
  from sparknlp.internal import AnnotatorTransformer
@@ -69,32 +68,11 @@ class Reader2Doc(
69
68
  |[{'document', 15, 38, 'This is a narrative text', {'pageNumber': 1, 'elementType': 'NarrativeText', 'fileName': 'pdf-title.pdf'}, []}]|
70
69
  |[{'document', 39, 68, 'This is another narrative text', {'pageNumber': 1, 'elementType': 'NarrativeText', 'fileName': 'pdf-title.pdf'}, []}]|
71
70
  +------------------------------------------------------------------------------------------------------------------------------------+
72
- """
71
+ """
73
72
 
74
73
  name = "Reader2Doc"
75
- outputAnnotatorType = AnnotatorType.DOCUMENT
76
-
77
-
78
- flattenOutput = Param(
79
- Params._dummy(),
80
- "flattenOutput",
81
- "If true, output is flattened to plain text with minimal metadata",
82
- typeConverter=TypeConverters.toBoolean
83
- )
84
74
 
85
- titleThreshold = Param(
86
- Params._dummy(),
87
- "titleThreshold",
88
- "Minimum font size threshold for title detection in PDF docs",
89
- typeConverter=TypeConverters.toFloat
90
- )
91
-
92
- outputAsDocument = Param(
93
- Params._dummy(),
94
- "outputAsDocument",
95
- "Whether to return all sentences joined into a single document",
96
- typeConverter=TypeConverters.toBoolean
97
- )
75
+ outputAnnotatorType = AnnotatorType.DOCUMENT
98
76
 
99
77
  excludeNonText = Param(
100
78
  Params._dummy(),
@@ -103,6 +81,16 @@ class Reader2Doc(
103
81
  typeConverter=TypeConverters.toBoolean
104
82
  )
105
83
 
84
+ def setExcludeNonText(self, value):
85
+ """Sets whether to exclude non-text content from the output.
86
+
87
+ Parameters
88
+ ----------
89
+ value : bool
90
+ Whether to exclude non-text content from the output. Default is False.
91
+ """
92
+ return self._set(excludeNonText=value)
93
+
106
94
  @keyword_only
107
95
  def __init__(self):
108
96
  super(Reader2Doc, self).__init__(classname="com.johnsnowlabs.reader.Reader2Doc")
@@ -117,44 +105,3 @@ class Reader2Doc(
117
105
  def setParams(self):
118
106
  kwargs = self._input_kwargs
119
107
  return self._set(**kwargs)
120
-
121
-
122
- def setFlattenOutput(self, value):
123
- """Sets whether to flatten the output to plain text with minimal metadata.
124
-
125
- ParametersF
126
- ----------
127
- value : bool
128
- If true, output is flattened to plain text with minimal metadata
129
- """
130
- return self._set(flattenOutput=value)
131
-
132
- def setTitleThreshold(self, value):
133
- """Sets the minimum font size threshold for title detection in PDF documents.
134
-
135
- Parameters
136
- ----------
137
- value : float
138
- Minimum font size threshold for title detection in PDF docs
139
- """
140
- return self._set(titleThreshold=value)
141
-
142
- def setOutputAsDocument(self, value):
143
- """Sets whether to return all sentences joined into a single document.
144
-
145
- Parameters
146
- ----------
147
- value : bool
148
- Whether to return all sentences joined into a single document
149
- """
150
- return self._set(outputAsDocument=value)
151
-
152
- def setExcludeNonText(self, value):
153
- """Sets whether to exclude non-text content from the output.
154
-
155
- Parameters
156
- ----------
157
- value : bool
158
- Whether to exclude non-text content from the output. Default is False.
159
- """
160
- return self._set(excludeNonText=value)
@@ -32,20 +32,6 @@ class Reader2Table(
32
32
 
33
33
  outputAnnotatorType = AnnotatorType.DOCUMENT
34
34
 
35
- flattenOutput = Param(
36
- Params._dummy(),
37
- "flattenOutput",
38
- "If true, output is flattened to plain text with minimal metadata",
39
- typeConverter=TypeConverters.toBoolean
40
- )
41
-
42
- titleThreshold = Param(
43
- Params._dummy(),
44
- "titleThreshold",
45
- "Minimum font size threshold for title detection in PDF docs",
46
- typeConverter=TypeConverters.toFloat
47
- )
48
-
49
35
  @keyword_only
50
36
  def __init__(self):
51
37
  super(Reader2Table, self).__init__(classname="com.johnsnowlabs.reader.Reader2Table")
@@ -55,23 +41,3 @@ class Reader2Table(
55
41
  def setParams(self):
56
42
  kwargs = self._input_kwargs
57
43
  return self._set(**kwargs)
58
-
59
- def setFlattenOutput(self, value):
60
- """Sets whether to flatten the output to plain text with minimal metadata.
61
-
62
- Parameters
63
- ----------
64
- value : bool
65
- If true, output is flattened to plain text with minimal metadata
66
- """
67
- return self._set(flattenOutput=value)
68
-
69
- def setTitleThreshold(self, value):
70
- """Sets the minimum font size threshold for title detection in PDF documents.
71
-
72
- Parameters
73
- ----------
74
- value : float
75
- Minimum font size threshold for title detection in PDF docs
76
- """
77
- return self._set(titleThreshold=value)
@@ -0,0 +1,159 @@
1
+ # Copyright 2017-2025 John Snow Labs
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ from pyspark import keyword_only
16
+
17
+ from sparknlp.common import AnnotatorType
18
+ from sparknlp.internal import AnnotatorTransformer
19
+ from sparknlp.partition.partition_properties import *
20
+
21
+ class ReaderAssembler(
22
+ AnnotatorTransformer,
23
+ HasReaderProperties,
24
+ HasHTMLReaderProperties,
25
+ HasEmailReaderProperties,
26
+ HasExcelReaderProperties,
27
+ HasPowerPointProperties,
28
+ HasTextReaderProperties,
29
+ HasPdfProperties
30
+ ):
31
+ """
32
+ The ReaderAssembler annotator provides a unified interface for combining multiple Spark NLP
33
+ readers (such as Reader2Doc, Reader2Table, and Reader2Image) into a single, configurable
34
+ component. It automatically orchestrates the execution of different readers based on input type,
35
+ configured priorities, and fallback strategies allowing you to handle diverse content formats
36
+ without manually chaining multiple readers in your pipeline.
37
+
38
+ ReaderAssembler simplifies the process of building flexible pipelines capable of ingesting and
39
+ processing documents, tables, and images in a consistent way. It handles reader selection,
40
+ ordering, and fault-tolerance internally, ensuring that pipelines remain concise, robust, and
41
+ easy to maintain.
42
+
43
+ Examples
44
+ --------
45
+ >>> from johnsnowlabs.reader import ReaderAssembler
46
+ >>> from pyspark.ml import Pipeline
47
+ >>>
48
+ >>> reader_assembler = ReaderAssembler() \\
49
+ ... .setContentType("text/html") \\
50
+ ... .setContentPath("/table-image.html") \\
51
+ ... .setOutputCol("document")
52
+ >>>
53
+ >>> pipeline = Pipeline(stages=[reader_assembler])
54
+ >>> pipeline_model = pipeline.fit(empty_data_set)
55
+ >>> result_df = pipeline_model.transform(empty_data_set)
56
+ >>>
57
+ >>> result_df.show()
58
+ +--------+--------------------+--------------------+--------------------+---------+
59
+ |fileName| document_text| document_table| document_image|exception|
60
+ +--------+--------------------+--------------------+--------------------+---------+
61
+ | null|[{'document', 0, 26...|[{'document', 0, 50...|[{'image', , 5, 5, ...| null|
62
+ +--------+--------------------+--------------------+--------------------+---------+
63
+
64
+ This annotator is especially useful when working with heterogeneous input data — for example,
65
+ when a dataset includes PDFs, spreadsheets, and images — allowing Spark NLP to automatically
66
+ invoke the appropriate reader for each file type while preserving a unified schema in the output.
67
+ """
68
+
69
+
70
+ name = 'ReaderAssembler'
71
+
72
+ outputAnnotatorType = AnnotatorType.DOCUMENT
73
+
74
+ excludeNonText = Param(
75
+ Params._dummy(),
76
+ "excludeNonText",
77
+ "Whether to exclude non-text content from the output. Default is False.",
78
+ typeConverter=TypeConverters.toBoolean
79
+ )
80
+
81
+ userMessage = Param(
82
+ Params._dummy(),
83
+ "userMessage",
84
+ "Custom user message.",
85
+ typeConverter=TypeConverters.toString
86
+ )
87
+
88
+ promptTemplate = Param(
89
+ Params._dummy(),
90
+ "promptTemplate",
91
+ "Format of the output prompt.",
92
+ typeConverter=TypeConverters.toString
93
+ )
94
+
95
+ customPromptTemplate = Param(
96
+ Params._dummy(),
97
+ "customPromptTemplate",
98
+ "Custom prompt template for image models.",
99
+ typeConverter=TypeConverters.toString
100
+ )
101
+
102
+ @keyword_only
103
+ def __init__(self):
104
+ super(ReaderAssembler, self).__init__(classname="com.johnsnowlabs.reader.ReaderAssembler")
105
+ self._setDefault(contentType="",
106
+ explodeDocs=False,
107
+ userMessage="Describe this image",
108
+ promptTemplate="qwen2vl-chat",
109
+ readAsImage=True,
110
+ customPromptTemplate="",
111
+ ignoreExceptions=True,
112
+ flattenOutput=False,
113
+ titleThreshold=18)
114
+
115
+
116
+ @keyword_only
117
+ def setParams(self):
118
+ kwargs = self._input_kwargs
119
+ return self._set(**kwargs)
120
+
121
+ def setExcludeNonText(self, value):
122
+ """Sets whether to exclude non-text content from the output.
123
+
124
+ Parameters
125
+ ----------
126
+ value : bool
127
+ Whether to exclude non-text content from the output. Default is False.
128
+ """
129
+ return self._set(excludeNonText=value)
130
+
131
+ def setUserMessage(self, value: str):
132
+ """Sets custom user message.
133
+
134
+ Parameters
135
+ ----------
136
+ value : str
137
+ Custom user message to include.
138
+ """
139
+ return self._set(userMessage=value)
140
+
141
+ def setPromptTemplate(self, value: str):
142
+ """Sets format of the output prompt.
143
+
144
+ Parameters
145
+ ----------
146
+ value : str
147
+ Prompt template format.
148
+ """
149
+ return self._set(promptTemplate=value)
150
+
151
+ def setCustomPromptTemplate(self, value: str):
152
+ """Sets custom prompt template for image models.
153
+
154
+ Parameters
155
+ ----------
156
+ value : str
157
+ Custom prompt template string.
158
+ """
159
+ return self._set(customPromptTemplate=value)