MCPcopy Create free account
hub / github.com/diffgram/diffgram / validate_input_from_text_data

Function validate_input_from_text_data

walrus/methods/input/packet.py:328–341  ·  view source on GitHub ↗
(input: dict, log: dict)

Source from the content-addressed store, hash-verified

326
327
328def validate_input_from_text_data(input: dict, log: dict):
329 if input.get('media') is None or input.get('media') == {}:
330 log['error'] = {}
331 log['error']['media'] = 'Provide media data. Needs to be {"type": str, "url": str<optional>}'
332
333 if input.get('media') is not None and input['media'].get('type') is None:
334 log['error'] = {}
335 log['error']['media.type'] = 'Provide media type needs to be ["text"]'
336
337 if input.get('text_data') is None:
338 log['error'] = {}
339 log['error']['text_data'] = 'Provide "text_data" as a string.'
340
341 return log
342
343
344def validate_input_from_blob_path(project: Project, input: dict, session: Session, log: dict):

Callers 1

Calls 1

getMethod · 0.45

Tested by

no test coverage detected