{"record":{"id":"dbcbc2f946fd1573","repo":"mlflow/mlflow","slug":"invalid-parameter-value-dbcbc2","errorCode":"INVALID_PARAMETER_VALUE","errorMessage":"Input messages should be list of dictionaries, but got: {type(messages)}.","messagePattern":"Input messages should be list of dictionaries, but got: (.+?)\\.","errorType":"validation","errorClass":"MlflowException","httpStatus":null,"severity":"error","filePath":"mlflow/transformers/llm_inference_utils.py","lineNumber":95,"sourceCode":"        raise MlflowException(\n            f\"When `task` is specified as `{inference_task}`, the signature would \"\n            \"be set by MLflow. Please do not set the signature.\"\n        )\n    return inferred_signature\n\n\ndef convert_messages_to_prompt(messages: list[dict[str, Any]], tokenizer) -> str:\n    \"\"\"For the Chat inference task, apply chat template to messages to create prompt.\n\n    Args:\n        messages: List of message e.g. [{\"role\": user, \"content\": xxx}, ...]\n        tokenizer: The tokenizer object used for inference.\n\n    Returns:\n        The prompt string contains the messages.\n    \"\"\"\n    if not (isinstance(messages, list) and all(isinstance(msg, dict) for msg in messages)):\n        raise MlflowException(\n            f\"Input messages should be list of dictionaries, but got: {type(messages)}.\",\n            error_code=INVALID_PARAMETER_VALUE,\n        )\n\n    try:\n        return tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)\n    except Exception as e:\n        raise MlflowException(f\"Failed to apply chat template: {e}\")\n\n\ndef preprocess_llm_inference_input(\n    data: pd.DataFrame | dict[str, Any],\n    params: dict[str, Any] | None = None,\n    flavor_config: dict[str, Any] | None = None,\n) -> tuple[list[Any], dict[str, Any]]:\n    \"\"\"\n    When a MLflow inference task is given, return updated `data` and `params` that\n    - Extract the parameters from the input data (from the first row if passed multiple rows)","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/mlflow/mlflow/blob/6a27f2decc0b76eb1b54af31849784addb357dbc/mlflow/transformers/llm_inference_utils.py#L77-L113","documentation":"Error \"Input messages should be list of dictionaries, but got: {type(messages)}.\" thrown in mlflow/mlflow.","triggerScenarios":"Thrown at mlflow/transformers/llm_inference_utils.py:95 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6a27f2decc0b76eb1b54af31849784addb357dbc","analyzedAt":"2026-08-29T20:54:51.419Z","schemaVersion":2},"datasetVersion":"2026-08-29T22:17:34.462Z"}