@@ -137,7 +137,7 @@ def create_record(
137
137
collection_id : str ,
138
138
* ,
139
139
type : Union [RecordType , str ],
140
- text_splitter : Union [TextSplitter , Dict [str , Any ]],
140
+ text_splitter : Optional [ Union [TextSplitter , Dict [str , Any ]]] = None ,
141
141
title : Optional [str ] = None ,
142
142
content : Optional [str ] = None ,
143
143
file_id : Optional [str ] = None ,
@@ -158,7 +158,8 @@ def create_record(
158
158
:return: The created record object.
159
159
"""
160
160
type = _validate_record_type (type , content , file_id , url )
161
- text_splitter = text_splitter if isinstance (text_splitter , TextSplitter ) else TextSplitter (** text_splitter )
161
+ if text_splitter :
162
+ text_splitter = text_splitter if isinstance (text_splitter , TextSplitter ) else TextSplitter (** text_splitter )
162
163
163
164
body = RecordCreateRequest (
164
165
title = title or "" ,
@@ -177,7 +178,7 @@ async def a_create_record(
177
178
collection_id : str ,
178
179
* ,
179
180
type : Union [RecordType , str ],
180
- text_splitter : Union [TextSplitter , Dict [str , Any ]],
181
+ text_splitter : Optional [ Union [TextSplitter , Dict [str , Any ]]] = None ,
181
182
title : Optional [str ] = None ,
182
183
content : Optional [str ] = None ,
183
184
file_id : Optional [str ] = None ,
@@ -199,7 +200,8 @@ async def a_create_record(
199
200
"""
200
201
201
202
type = _validate_record_type (type , content , file_id , url )
202
- text_splitter = text_splitter if isinstance (text_splitter , TextSplitter ) else TextSplitter (** text_splitter )
203
+ if text_splitter :
204
+ text_splitter = text_splitter if isinstance (text_splitter , TextSplitter ) else TextSplitter (** text_splitter )
203
205
204
206
body = RecordCreateRequest (
205
207
title = title or "" ,
0 commit comments