{"record":{"id":"20819997ac8269ce","repo":"microsoft/semantic-kernel","slug":"the-specified-type-type-value-is-not-supported","errorCode":null,"errorMessage":"The specified type `{type_value}` is not supported. Allowed types are: `auto`, `none`, `required`.","messagePattern":"The specified type `(.+?)` is not supported\\. Allowed types are: `auto`, `none`, `required`\\.","errorType":"exception","errorClass":"ServiceInitializationError","httpStatus":null,"severity":"error","filePath":"python/semantic_kernel/connectors/ai/function_choice_behavior.py","lineNumber":222,"sourceCode":"            filters=filters,\n            **data,\n        )\n\n    @classmethod\n    def from_string(cls: type[_T], data: str) -> _T:\n        \"\"\"Create a FunctionChoiceBehavior from a string.\n\n        This method converts the provided string to a FunctionChoiceBehavior object\n        for the specified type.\n        \"\"\"\n        type_value = data.lower()\n        if type_value == \"auto\":\n            return cls.Auto()\n        if type_value == \"none\":\n            return cls.NoneInvoke()\n        if type_value == \"required\":\n            return cls.Required()\n        raise ServiceInitializationError(\n            f\"The specified type `{type_value}` is not supported. Allowed types are: `auto`, `none`, `required`.\"\n        )\n","sourceCodeStart":204,"sourceCodeEnd":225,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/semantic_kernel/connectors/ai/function_choice_behavior.py#L204-L225","documentation":"Raised by FunctionChoiceBehavior.from_string when the provided string (lowercased) is not one of 'auto', 'none', or 'required'. from_string maps a behavior keyword to a behavior instance, so any other value is unsupported.","triggerScenarios":"Calling FunctionChoiceBehavior.from_string('tool'), from_string('always'), from_string(''), or any value outside the allowed set; a config-driven code path that feeds an unvalidated string into from_string.","commonSituations":"User config or CLI argument with a typo; expecting an OpenAI-style value like 'required'/'none'/'auto' but passing 'tools' or 'function'; migrating from an older API that accepted different keywords.","solutions":["Use exactly one of: 'auto', 'none', or 'required' (case-insensitive).","Validate/whitelist the input string before calling from_string and surface a friendly error to the end user.","If you need richer config (filters, auto_invoke), use FunctionChoiceBehavior.from_dict or the Auto/NoneInvoke/Required classmethods directly."],"exampleFix":"# before\nbehavior = FunctionChoiceBehavior.from_string(\"tool\")\n# after\nbehavior = FunctionChoiceBehavior.from_string(\"required\")","handlingStrategy":"validation","validationCode":"ALLOWED = {\"auto\", \"none\", \"required\"}\n\ndef is_valid_behavior_string(value: str) -> bool:\n    return isinstance(value, str) and value.lower() in ALLOWED","typeGuard":"ALLOWED = {\"auto\", \"none\", \"required\"}\n\ndef is_function_choice_string(value: object) -> bool:\n    return isinstance(value, str) and value.lower() in ALLOWED","tryCatchPattern":"from semantic_kernel.exceptions.service_exceptions import ServiceInitializationError\n\ntry:\n    behavior = FunctionChoiceBehavior.from_string(raw)\nexcept ServiceInitializationError as e:\n    if \"not supported\" in str(e):\n        raise ValueError(f\"Invalid function choice '{raw}'. Use one of: auto, none, required\") from e\n    raise","preventionTips":["Whitelist the input string to auto/none/required before calling from_string.","Prefer FunctionChoiceBehavior.Auto/NoneInvoke/Required classmethods for compile-time safety.","Validate config-driven strings at the boundary before they reach from_string."],"tags":["function-calling","configuration","validation"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}