{"record":{"id":"b382b981f7c3d4c2","repo":"chroma-core/chroma","slug":"the-task-type-cannot-be-changed-after-the-embeddin","errorCode":null,"errorMessage":"The task type cannot be changed after the embedding function has been initialized.","messagePattern":"The task type cannot be changed after the embedding function has been initialized\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"chromadb/utils/embedding_functions/google_embedding_function.py","lineNumber":348,"sourceCode":"    def get_config(self) -> Dict[str, Any]:\n        config: Dict[str, Any] = {\n            \"api_key_env_var\": self.api_key_env_var,\n            \"model_name\": self.model_name,\n            \"task_type\": self.task_type,\n        }\n        if self.dimension is not None:\n            config[\"dimension\"] = self.dimension\n        return config\n\n    def validate_config_update(\n        self, old_config: Dict[str, Any], new_config: Dict[str, Any]\n    ) -> None:\n        if \"model_name\" in new_config:\n            raise ValueError(\n                \"The model name cannot be changed after the embedding function has been initialized.\"\n            )\n        if \"task_type\" in new_config:\n            raise ValueError(\n                \"The task type cannot be changed after the embedding function has been initialized.\"\n            )\n        if \"dimension\" in new_config:\n            raise ValueError(\n                \"The dimension cannot be changed after the embedding function has been initialized.\"\n            )\n\n    @staticmethod\n    def validate_config(config: Dict[str, Any]) -> None:\n        \"\"\"\n        Validate the configuration using the JSON schema.\n\n        Args:\n            config: Configuration to validate\n\n        Raises:\n            ValidationError: If the configuration does not match the schema\n        \"\"\"","sourceCodeStart":330,"sourceCodeEnd":366,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/utils/embedding_functions/google_embedding_function.py#L330-L366","documentation":"Error \"The task type cannot be changed after the embedding function has been initialized.\" thrown in chroma-core/chroma.","triggerScenarios":"Thrown at chromadb/utils/embedding_functions/google_embedding_function.py:348 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":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}