{"id":"a0d14b4a91a1f4ef","repo":"redis/redis-py","slug":"input-should-be-provided","errorCode":null,"errorMessage":"'input' should be provided","messagePattern":"'input' should be provided","errorType":"validation","errorClass":"DataError","httpStatus":null,"severity":"error","filePath":"redis/commands/vectorset/commands.py","lineNumber":253,"sourceCode":"        ``ef`` sets the exploration factor.\n\n        ``filter`` sets the filter that should be applied for the search.\n\n        ``filter_ef`` sets the max filtering effort.\n\n        ``truth`` when enabled, forces the command to perform a linear scan.\n\n        ``no_thread`` when enabled forces the command to execute the search\n                on the data structure in the main thread.\n\n        ``epsilon`` floating point between 0 and 1, if specified will return\n                only elements with distance no further than the specified one.\n\n        For more information, see https://redis.io/commands/vsim.\n        \"\"\"\n\n        if not input:\n            raise DataError(\"'input' should be provided\")\n\n        pieces = []\n        options = {}\n\n        if isinstance(input, bytes):\n            pieces.extend([\"FP32\", input])\n        elif isinstance(input, list):\n            pieces.extend([\"VALUES\", len(input)])\n            pieces.extend(input)\n        else:\n            pieces.extend([\"ELE\", input])\n\n        if with_scores or with_attribs:\n            if check_protocol_version(get_protocol_version(self.client), 3):\n                options[CallbacksOptions.RESP3.value] = True\n\n            if with_scores:\n                pieces.append(\"WITHSCORES\")","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/redis/redis-py/blob/da03cdc7e8731092b13e395605c3c1fb2de25de1/redis/commands/vectorset/commands.py#L235-L271","documentation":"Raised by VectorSetCommands.vsim when the input argument is falsy. input can be a list of floats, raw bytes, or an existing element name (string); an empty list, empty bytes, or empty string is rejected because there is nothing to compare against. The check is 'not input'.","triggerScenarios":"client.vsim('set', []) (empty vector list), client.vsim('set', b'') (empty bytes), or client.vsim('set', '') (empty element name). Common when the input vector came from a failed embedding call or the element name was blank.","commonSituations":"Embedding model returned an empty vector for empty/whitespace query text; element-based lookup with a missing identifier; passing a query vector variable that was never populated.","solutions":["Provide a non-empty vector list, non-empty bytes, or a non-empty element name.","Guard the call: if input: client.vsim('set', input).","Fix the upstream embedding/identifier source so it never yields empty."],"exampleFix":"// before\nclient.vsim('set', query_vec)  # query_vec == []\n// after\nif query_vec:\n    client.vsim('set', query_vec)","handlingStrategy":"validation","validationCode":"def safe_vsim(client, key, input, **kw):\n    if not input:\n        return None\n    return client.vsim(key, input, **kw)","typeGuard":"def vsim_input_valid(input) -> bool:\n    return bool(input)","tryCatchPattern":"try:\n    client.vsim('set', inp)\nexcept Exception as e:\n    if \"'input' should be provided\" in str(e):\n        return None\n    raise","preventionTips":["Check the query vector/element is non-empty before vsim.","Guard embedding pipelines that may return empty.","Treat empty input as 'no query'."],"tags":["vectorset","vsim","argument-error","validation"],"analyzedSha":"da03cdc7e8731092b13e395605c3c1fb2de25de1","analyzedAt":"2026-08-04T20:26:47.563Z","schemaVersion":2}