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

Method post

apps/knowledge/views/document.py:242–262  ·  view source on GitHub ↗
(self, request: Request, workspace_id: str, knowledge_id: str)

Source from the content-addressed store, hash-verified

240 ),
241 )
242 def post(self, request: Request, workspace_id: str, knowledge_id: str):
243 split_data = {"file": request.FILES.getlist("file")}
244 request_data = request.data
245 if (
246 "patterns" in request.data
247 and request.data.get("patterns") is not None
248 and len(request.data.get("patterns")) > 0
249 ):
250 split_data.__setitem__("patterns", request_data.getlist("patterns"))
251 if "limit" in request.data:
252 split_data.__setitem__("limit", request_data.get("limit"))
253 if "with_filter" in request.data:
254 split_data.__setitem__("with_filter", request_data.get("with_filter"))
255 return result.success(
256 DocumentSerializers.Split(
257 data={
258 "workspace_id": workspace_id,
259 "knowledge_id": knowledge_id,
260 }
261 ).parse(split_data)
262 )
263
264 class SplitPattern(APIView):
265 authentication_classes = [TokenAuth]

Callers

nothing calls this directly

Calls 4

__setitem__Method · 0.80
getMethod · 0.45
successMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected