MCPcopy Index your code
hub / github.com/1Panel-dev/MaxKB / parse

Method parse

apps/knowledge/serializers/document.py:1225–1242  ·  view source on GitHub ↗
(self, instance)

Source from the content-addressed store, hash-verified

1223 )
1224
1225 def parse(self, instance):
1226 self.is_valid(instance=instance, raise_exception=True)
1227 DocumentSplitRequest(data=instance).is_valid(raise_exception=True)
1228
1229 file_list = instance.get("file")
1230 return reduce(
1231 lambda x, y: [*x, *y],
1232 [
1233 self.file_to_paragraph(
1234 f,
1235 instance.get("patterns", None),
1236 instance.get("with_filter", None),
1237 instance.get("limit", 4096),
1238 )
1239 for f in file_list
1240 ],
1241 [],
1242 )
1243
1244 def save_image(self, image_list):
1245 if image_list is not None and len(image_list) > 0:

Callers 4

handlerMethod · 0.45
syncMethod · 0.45
handlerFunction · 0.45
postMethod · 0.45

Calls 5

is_validMethod · 0.95
file_to_paragraphMethod · 0.95
is_validMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected