deployment.bff.app.v1.routers.helper module#

deployment.bff.app.v1.routers.helper.process_query(text='', blob=b'', uri=None, conditions=None)[source]#

Processes query image or text into a document and prepares the filetring query for the results. Currently we support ‘$and’ between different conditions means we return results that have all the conditions. Also we only support ‘$eq’ opperand for tag which means a tag should be equal to an exact value. Same query is passed to either docarray and annlite indexers, in docarray executor we do preprocessing by adding tags__ to the query

Parameters
  • text (str) – text of the query

  • blob (str) – the blob of the image

  • uri (Optional[str]) – uri of the ressource provided

  • conditions (Optional[dict]) – dictionary with the conditions to apply as filter tag should be the key and desired value is assigned as value to the key

Return type

Document

deployment.bff.app.v1.routers.helper.get_jina_client(host, port)[source]#
Return type

Client

deployment.bff.app.v1.routers.helper.jina_client_post(data, endpoint, inputs, parameters=None, *args, **kwargs)[source]#

Posts to the endpoint of the Jina client.

Parameters
  • data – contains the request model of the flow

  • endpoint (str) – endpoint which shall be called, e.g. ‘/index’ or ‘/search’

  • inputs – document(s) which shall be passed in

  • parameters – parameters to pass to the executors, e.g. jwt for securitization or limit for search

  • args – any additional arguments passed to the client.post method

  • kwargs – any additional keyword arguments passed to the client.post method

Return type

DocumentArray

Returns

response of client.post