{"record":{"id":"2fb461b5d59b1e48","repo":"weaviate/weaviate","slug":"wrong-temperature-configuration-values-are-betwee-2fb461","errorCode":null,"errorMessage":"Wrong temperature configuration, values are between 0.0 and 1.0","messagePattern":"Wrong temperature configuration, values are between 0\\.0 and 1\\.0","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/generative-databricks/config/class_settings.go","lineNumber":64,"sourceCode":"\ntype classSettings struct {\n\tcfg                  moduletools.ClassConfig\n\tpropertyValuesHelper basesettings.PropertyValuesHelper\n}\n\nfunc NewClassSettings(cfg moduletools.ClassConfig) ClassSettings {\n\treturn &classSettings{cfg: cfg, propertyValuesHelper: basesettings.NewPropertyValuesHelper(\"generative-databricks\")}\n}\n\nfunc (ic *classSettings) Validate(class *models.Class) error {\n\tif ic.cfg == nil {\n\t\t// we would receive a nil-config on cross-class requests, such as Explore{}\n\t\treturn errors.New(\"empty config\")\n\t}\n\n\ttemperature := ic.getFloatProperty(temperatureProperty, &DefaultDatabricksTemperature)\n\tif temperature == nil || (*temperature < 0 || *temperature > 1) {\n\t\treturn errors.Errorf(\"Wrong temperature configuration, values are between 0.0 and 1.0\")\n\t}\n\n\tmaxTokens := ic.getIntProperty(maxTokensProperty, nil)\n\tif maxTokens != nil && *maxTokens <= 0 {\n\t\treturn errors.Errorf(\"Wrong maxTokens configuration, values should be greater than zero or nil\")\n\t}\n\n\ttopP := ic.getFloatProperty(topPProperty, &DefaultDatabricksTopP)\n\tif topP == nil || (*topP < 0 || *topP > 5) {\n\t\treturn errors.Errorf(\"Wrong topP configuration, values are should have a minimal value of 1 and max of 5\")\n\t}\n\n\ttopK := ic.getIntProperty(topKProperty, &DefaultDatabricksTopK)\n\tif topK != nil && (*topK <= 0) {\n\t\treturn errors.Errorf(\"Wrong topK configuration, values should be greater than zero or nil\")\n\t}\n\n\treturn nil","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/modules/generative-databricks/config/class_settings.go#L46-L82","documentation":"Validation error raised in ClassSettings.Validate when the generative-databricks 'temperature' module setting is absent-with-unparseable-value or outside the accepted range [0.0, 1.0] (class_settings.go:62-65). Note the check also fails when getFloatProperty returns the sentinel -1.0 'wrong value' (non-numeric input), so a non-numeric temperature like \"hot\" also lands here. It is returned at schema/class-creation time, before any request is made.","triggerScenarios":"Creating or patching a collection with moduleConfig generative-databricks: {\"temperature\": 1.5} or temperature < 0, or a temperature value that cannot be parsed as a float (strings, null where number expected).","commonSituations":"Copying OpenAI-style configs (OpenAI allows up to 2.0) into Databricks settings; YAML/JSON quoting mistakes turning 0.7 into \"0.7\" in some tooling; UI form input allowing out-of-range decimals.","solutions":["Set temperature to a float between 0.0 and 1.0 inclusive in the generative-databricks module config.","Remove the temperature property entirely to use the default (1.0).","Ensure the value is a JSON number, not a string: 0.5 not \"0.5\".","Re-apply the collection schema update after fixing."],"exampleFix":"// before\n\"moduleConfig\": { \"generative-databricks\": { \"temperature\": 1.7 } }\n// after\n\"moduleConfig\": { \"generative-databricks\": { \"temperature\": 0.7 } }","handlingStrategy":"validation","validationCode":"// JS/TS (client-side pre-check before schema create/update)\nfunction validateDatabricksTemperature(cfg) {\n  const t = cfg?.moduleConfig?.[\"generative-databricks\"]?.temperature;\n  if (t === undefined) return true; // default applies\n  return typeof t === \"number\" && t >= 0 && t <= 1;\n}","typeGuard":"function isValidTemperature(v) {\n  return typeof v === \"number\" && Number.isFinite(v) && v >= 0 && v <= 1;\n}","tryCatchPattern":"// JS\ntry {\n  await client.schema.classCreator().withClass(classDef).do();\n} catch (e) {\n  if (String(e).includes(\"Wrong temperature configuration\")) {\n    // fix temperature to [0.0, 1.0] and re-apply\n  }\n}","preventionTips":["Remember Databricks module caps temperature at 1.0 (unlike OpenAI's 2.0).","Send JSON numbers, never quoted strings, for numeric settings.","Validate moduleConfig with the module's range rules in your IaC/schema tooling before apply.","Omit temperature entirely to accept the default 1.0."],"tags":["validation","configuration","schema","databricks"],"backgroundTag":"invalid-config-value","analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}