@@ -137,7 +137,7 @@ def create_record(
137137 collection_id : str ,
138138 * ,
139139 type : Union [RecordType , str ],
140- text_splitter : Union [TextSplitter , Dict [str , Any ]],
140+ text_splitter : Optional [ Union [TextSplitter , Dict [str , Any ]]] = None ,
141141 title : Optional [str ] = None ,
142142 content : Optional [str ] = None ,
143143 file_id : Optional [str ] = None ,
@@ -158,7 +158,8 @@ def create_record(
158158 :return: The created record object.
159159 """
160160 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 )
162163
163164 body = RecordCreateRequest (
164165 title = title or "" ,
@@ -177,7 +178,7 @@ async def a_create_record(
177178 collection_id : str ,
178179 * ,
179180 type : Union [RecordType , str ],
180- text_splitter : Union [TextSplitter , Dict [str , Any ]],
181+ text_splitter : Optional [ Union [TextSplitter , Dict [str , Any ]]] = None ,
181182 title : Optional [str ] = None ,
182183 content : Optional [str ] = None ,
183184 file_id : Optional [str ] = None ,
@@ -199,7 +200,8 @@ async def a_create_record(
199200 """
200201
201202 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 )
203205
204206 body = RecordCreateRequest (
205207 title = title or "" ,
0 commit comments