diff --git a/waspc/src/Wasp/AI/GenerateNewProject/Common.hs b/waspc/src/Wasp/AI/GenerateNewProject/Common.hs index fefb61d61..9e7d8fe5f 100644 --- a/waspc/src/Wasp/AI/GenerateNewProject/Common.hs +++ b/waspc/src/Wasp/AI/GenerateNewProject/Common.hs @@ -33,7 +33,8 @@ data NewProjectConfig = NewProjectConfig { projectAuth :: !(Maybe AuthProvider), -- One of the Tailwind color names: https://tailwindcss.com/docs/customizing-colors projectPrimaryColor :: !(Maybe String), - projectDefaultGptModel :: !(Maybe GPT.Model) + projectDefaultGptModel :: !(Maybe GPT.Model), + projectDefaultGptTemperature :: !(Maybe Float) } deriving (Show) @@ -42,11 +43,13 @@ instance Aeson.FromJSON NewProjectConfig where auth <- obj .:? "auth" primaryColor <- obj .:? "primaryColor" defaultGptModel <- obj .:? "defaultGptModel" + defaultGptTemperature <- obj .:? "defaultGptTemperature" return ( NewProjectConfig { projectAuth = auth, projectPrimaryColor = primaryColor, - projectDefaultGptModel = defaultGptModel + projectDefaultGptModel = defaultGptModel, + projectDefaultGptTemperature = defaultGptTemperature } ) @@ -55,7 +58,8 @@ emptyNewProjectConfig = NewProjectConfig { projectAuth = Nothing, projectPrimaryColor = Nothing, - projectDefaultGptModel = Nothing + projectDefaultGptModel = Nothing, + projectDefaultGptTemperature = Nothing } getProjectAuth :: NewProjectDetails -> AuthProvider @@ -133,7 +137,7 @@ defaultChatGPTParams :: NewProjectDetails -> ChatGPTParams defaultChatGPTParams projectDetails = GPT.ChatGPTParams { GPT._model = fromMaybe GPT.GPT_3_5_turbo_16k (projectDefaultGptModel $ _projectConfig projectDetails), - GPT._temperature = Just 0.7 + GPT._temperature = Just $ fromMaybe 0.7 (projectDefaultGptTemperature $ _projectConfig projectDetails) } defaultChatGPTParamsForFixing :: NewProjectDetails -> ChatGPTParams