{"record":{"id":"ac2c8a503a29a343","repo":"BerriAI/litellm","slug":"task-type-task-type-is-not-supported","errorCode":null,"errorMessage":"Task type {task_type} is not supported","messagePattern":"Task type (.+?) is not supported","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"litellm/llms/bedrock/image_generation/amazon_nova_canvas_transformation.py","lineNumber":148,"sourceCode":"                inpainting_params_typed: Final = AmazonNovaCanvasInpaintingParams(**inpainting_params)\n            except Exception as e:\n                raise ValueError(\n                    f\"Error transforming inpainting params: {e}. Got params: {inpainting_params}, Expected params: {AmazonNovaCanvasInpaintingParams.__annotations__}\"\n                )\n\n            try:\n                image_generation_config_typed = AmazonNovaCanvasImageGenerationConfig(**image_generation_config)\n            except Exception as e:\n                raise ValueError(\n                    f\"Error transforming image generation config: {e}. Got params: {image_generation_config}, Expected params: {AmazonNovaCanvasImageGenerationConfig.__annotations__}\"\n                )\n\n            return AmazonNovaCanvasInpaintingRequest(\n                taskType=task_type,\n                inpaintingParams=inpainting_params_typed,\n                imageGenerationConfig=image_generation_config_typed,\n            )\n        raise NotImplementedError(f\"Task type {task_type} is not supported\")\n\n    @classmethod\n    def map_openai_params(cls, non_default_params: dict, optional_params: dict) -> dict:\n        \"\"\"\n        Map the OpenAI params to the Bedrock params\n        \"\"\"\n        _size: Final = non_default_params.get(\"size\")\n        if _size is not None:\n            width, height = _size.split(\"x\")\n            optional_params[\"width\"], optional_params[\"height\"] = (\n                int(width),\n                int(height),\n            )\n        if non_default_params.get(\"n\") is not None:\n            optional_params[\"numberOfImages\"] = non_default_params.get(\"n\")\n        if non_default_params.get(\"quality\") is not None:\n            if non_default_params.get(\"quality\") in (\"hd\", \"premium\"):\n                optional_params[\"quality\"] = \"premium\"","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/bedrock/image_generation/amazon_nova_canvas_transformation.py#L130-L166","documentation":"The Nova Canvas request transformer only supports a fixed set of task types (e.g. COLOR_GUIDED_GENERATION, INPAINTING, and text-to-image handling upstream). If the resolved task_type string matches none of the if/elif branches, a NotImplementedError is raised naming the unsupported task type.","triggerScenarios":"Setting image_generation_config to a taskType litellm does not map yet, such as 'OUTPAINTING', 'BACKGROUND_REMOVAL', 'IMAGE_VARIATION', or a typo like 'inpainting' (wrong case).","commonSituations":"New Nova Canvas task types added by AWS but not yet supported by the installed litellm version; case mismatches; passing an arbitrary taskType string through the config.","solutions":["Check the task_type spelling/case against the AWS Nova Canvas API (e.g. INPAINTING, COLOR_GUIDED_GENERATION).","If the task is genuinely unsupported (e.g. OUTPAINTING), upgrade litellm to a version that supports it.","If still unsupported, call the Bedrock InvokeModel/bedrock-runtime API directly with the raw payload via litellm.completion-style passthrough (bedrock/invoke model string) instead of the image_generation helper."],"exampleFix":"# before\nimage_generation_config={\"taskType\": \"outpainting\", ...}  # wrong case + unsupported\n\n# after\nimage_generation_config={\"inpaintingParams\": {...}}  # use a supported task, correct casing","handlingStrategy":"type-guard","validationCode":"SUPPORTED_NOVA_TASKS = {\"COLOR_GUIDED_GENERATION\", \"INPAINTING\"}  # per installed litellm; verify in release notes\n\ndef task_supported(task_type: str) -> bool:\n    return task_type in SUPPORTED_NOVA_TASKS","typeGuard":"def is_supported_task_type(t: str) -> bool:\n    return isinstance(t, str) and t in {\"COLOR_GUIDED_GENERATION\", \"INPAINTING\"}","tryCatchPattern":"try:\n    litellm.image_generation(model=model, prompt=p, image_generation_config=cfg)\nexcept NotImplementedError as e:\n    raise UserFacingError(f\"Task not supported by installed litellm: {e}\") from e","preventionTips":["Check litellm release notes / the transformation file for supported Nova Canvas task types before adopting one.","Uppercase task types exactly as the AWS API documents them.","Feature-detect at startup with a cheap dry validation rather than in production traffic."],"tags":["bedrock","nova-canvas","not-implemented","task-type","image-generation"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}