{"record":{"id":"5aaaa23c731bd09d","repo":"BerriAI/litellm","slug":"input-must-be-a-list-of-strings","errorCode":null,"errorMessage":"Input must be a list of strings","messagePattern":"Input must be a list of strings","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/cohere/embed/transformation.py","lineNumber":126,"sourceCode":"                model=model,\n                texts=input,\n                input_type=COHERE_DEFAULT_EMBEDDING_INPUT_TYPE,\n            )\n\n        for k, v in inference_params.items():\n            transformed_request[k] = v\n\n        return transformed_request\n\n    def transform_embedding_request(\n        self,\n        model: str,\n        input: AllEmbeddingInputValues,\n        optional_params: dict,\n        headers: dict,\n    ) -> dict:\n        if isinstance(input, list) and (isinstance(input[0], list) or isinstance(input[0], int)):\n            raise ValueError(\"Input must be a list of strings\")\n        return cast(\n            dict,\n            self._transform_request(\n                model=model,\n                input=cast(list[str], input) if isinstance(input, list) else [input],\n                inference_params=optional_params,\n            ),\n        )\n\n    def _calculate_usage(self, input: list[str], encoding: Any, meta: dict) -> Usage:\n        input_tokens = 0\n\n        text_tokens: Final[int | None] = meta.get(\"billed_units\", {}).get(\"input_tokens\")\n\n        image_tokens: Final[int | None] = meta.get(\"billed_units\", {}).get(\"images\")\n\n        prompt_tokens_details: PromptTokensDetailsWrapper | None = None\n        if image_tokens is None and text_tokens is None:","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/cohere/embed/transformation.py#L108-L144","documentation":"Error \"Input must be a list of strings\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/cohere/embed/transformation.py:126 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass input as a list of strings."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}