{"record":{"id":"e9d20d333d6b8897","repo":"sigoden/aichat","slug":"function-calling-cannot-be-enabled-because-no-func","errorCode":null,"errorMessage":"Function calling cannot be enabled because no functions are installed.","messagePattern":"Function calling cannot be enabled because no functions are installed\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/config/mod.rs","lineNumber":676,"sourceCode":"                let value = parse_value(value)?;\n                config.write().set_compress_threshold(value);\n            }\n            \"rag_reranker_model\" => {\n                let value = parse_value(value)?;\n                Self::set_rag_reranker_model(config, value)?;\n            }\n            \"rag_top_k\" => {\n                let value = value.parse().with_context(|| \"Invalid value\")?;\n                Self::set_rag_top_k(config, value)?;\n            }\n            \"dry_run\" => {\n                let value = value.parse().with_context(|| \"Invalid value\")?;\n                config.write().dry_run = value;\n            }\n            \"function_calling\" => {\n                let value = value.parse().with_context(|| \"Invalid value\")?;\n                if value && config.write().functions.is_empty() {\n                    bail!(\"Function calling cannot be enabled because no functions are installed.\")\n                }\n                config.write().function_calling = value;\n            }\n            \"stream\" => {\n                let value = value.parse().with_context(|| \"Invalid value\")?;\n                config.write().stream = value;\n            }\n            \"save\" => {\n                let value = value.parse().with_context(|| \"Invalid value\")?;\n                config.write().save = value;\n            }\n            \"highlight\" => {\n                let value = value.parse().with_context(|| \"Invalid value\")?;\n                config.write().highlight = value;\n            }\n            _ => bail!(\"Unknown key '{key}'\"),\n        }\n        Ok(())","sourceCodeStart":658,"sourceCodeEnd":694,"githubUrl":"https://github.com/sigoden/aichat/blob/82976d349ad97ac9aae0655ad631dace5e2a6385/src/config/mod.rs#L658-L694","documentation":"Fires in update() when setting function_calling to true while the configuration has no functions installed (config.functions is empty). The guard prevents enabling function calling in a state where the model would have no tools to call; the input at fault is the value 'true' for the function_calling key.","triggerScenarios":"Thrown at src/config/mod.rs:676 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install or define at least one function before enabling function calling","Leave function_calling disabled if no functions are needed","Check the functions directory configuration if functions were expected to be present"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"82976d349ad97ac9aae0655ad631dace5e2a6385","analyzedAt":"2026-09-09T18:33:06.139Z","contentChangedAt":"2026-09-09T18:33:06.139Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}