now.executor.gateway.bff.app.v1.routers.helper module#
- now.executor.gateway.bff.app.v1.routers.helper.field_dict_to_mm_doc(field_dict, data_class, modalities_dict, field_names_to_dataclass_fields={})[source]#
Converts a dictionary of field names to their values to a document. :type field_dict:
Dict
:param field_dict: key-value pairs of field names and their values :type data_class:Type
:param data_class: @docarray.dataclass class which encapsulates the fields of the multimodal document :type modalities_dict:Dict
:param modalities_dict: dictionary of field names to their modalities :param field_names_to_dataclass_fields: mapping of field names to data class fields (e.g. {‘title’: ‘text_0’}) :rtype:Document
:return: multi-modal document
- async now.executor.gateway.bff.app.v1.routers.helper.jina_client_post(request_model, endpoint, docs, parameters=None, *args, **kwargs)[source]#
Posts to the endpoint of the Jina client. :param request_model: contains the request model of the flow :type endpoint:
str
:param endpoint: endpoint which shall be called, e.g. ‘/index’ or ‘/search’ :type docs:Union
[Document
,DocumentArray
] :param docs: document(s) which shall be passed in :param parameters: parameters to pass to the executors, e.g. jwt for securitization or limit for search :param args: any additional arguments passed to the client.post method :param kwargs: any additional keyword arguments passed to the client.post method :rtype:DocumentArray
:return: response of client.post