๐Debugging Missionยทbeginnerยทโฑ๏ธ 15โ30mยทโญ 100 XP
M-008Tune the Temperature Settings
Description
Nebula Corp's AI platform lets users run different tasks โ data extraction, creative writing, code generation, and chatbot conversations. But the temperature configuration is all wrong: creative tasks use temperature 0, extraction uses temperature 1.5, and the chatbot is set to 2.0. Users are complaining about boring marketing copy and broken JSON outputs. Fix the configuration function so each task type uses an appropriate temperature and top-p setting.
Symptoms
wrong-outputJSON extraction returns creative, varied outputs that break parsers because temperature is 1.5 instead of 0
wrong-outputCreative writing tasks produce repetitive, boring output because temperature is 0 instead of ~1.0
wrong-outputChatbot produces nonsensical gibberish because temperature 2.0 is far too high
wrong-outputCode generation has too many hallucinated function names due to high temperature
wrong-outputvalidateConfig accepts temperature 5.0 as valid, which no model supports
wrong-outputvalidateConfig accepts topP 1.5 as valid, but topP must be 0-1
Expected Behavior (6)
Extraction uses temperature 0
Data extraction needs deterministic output โ temperature should be 0 or very close to 0
Input:getModelConfig('extraction')
Expected:RANGE:temperature:0.0:0.1
Creative uses high temperature
Creative writing benefits from temperature 0.8-1.2 for diverse output
Input:getModelConfig('creative')
Expected:RANGE:temperature:0.8:1.2
Chatbot uses moderate temperature
Chatbots need balanced temperature โ natural but not nonsensical
Input:getModelConfig('chatbot')
Expected:RANGE:temperature:0.5:0.8
Code uses low temperature
Code generation needs low temperature for correctness
Input:getModelConfig('code')
Expected:RANGE:temperature:0.0:0.3
Validates temperature range 0-2
Temperature 5.0 should be rejected โ valid range is 0 to 2
Input:validateConfig({temperature: 5.0, topP: 0.9})
Expected:CONTAINS:false
Validates topP range 0-1
topP 1.5 should be rejected โ valid range is 0 to 1
Input:validateConfig({temperature: 0.5, topP: 1.5})
Expected:CONTAINS:false
Related Lessons
Click Run / Check to validate your solution