diff --git a/waspc/cli/exe/Main.hs b/waspc/cli/exe/Main.hs index a53d3cbcf..132b13aa6 100644 --- a/waspc/cli/exe/Main.hs +++ b/waspc/cli/exe/Main.hs @@ -9,6 +9,7 @@ import Data.List (intercalate) import Main.Utf8 (withUtf8) import System.Environment (getArgs) import Wasp.Cli.Command (runCommand) +import qualified Wasp.Cli.Command.AI.New as Command.AI.New import Wasp.Cli.Command.BashCompletion (bashCompletion, generateBashCompletionScript, printBashCompletionInstruction) import Wasp.Cli.Command.Build (build) import qualified Wasp.Cli.Command.Call as Command.Call @@ -38,6 +39,7 @@ main = withUtf8 . (`E.catch` handleInternalErrors) $ do args <- getArgs let commandCall = case args of ["new", projectName] -> Command.Call.New projectName + ["ai-new"] -> Command.Call.AINew ["start"] -> Command.Call.Start ["start", "db"] -> Command.Call.StartDb ["clean"] -> Command.Call.Clean @@ -61,6 +63,7 @@ main = withUtf8 . (`E.catch` handleInternalErrors) $ do case commandCall of Command.Call.New projectName -> runCommand $ createNewProject projectName + Command.Call.AINew -> runCommand Command.AI.New.new Command.Call.Start -> runCommand start Command.Call.StartDb -> runCommand Command.Start.Db.start Command.Call.Clean -> runCommand clean diff --git a/waspc/cli/src/Wasp/Cli/Command/AI/GenerateNewProject/Plan.hs b/waspc/cli/src/Wasp/Cli/Command/AI/GenerateNewProject/Plan.hs index d03de3212..efc9df2ca 100644 --- a/waspc/cli/src/Wasp/Cli/Command/AI/GenerateNewProject/Plan.hs +++ b/waspc/cli/src/Wasp/Cli/Command/AI/GenerateNewProject/Plan.hs @@ -37,7 +37,7 @@ generatePlan newProjectDetails = do where -- TODO: Try configuring temperature. -- TODO: Make sure we have max_tokens set to high enough. - chatGPTParams = ChatGPTParams {_model = GPT_3_5_turbo_16k, _temperature = Nothing} + chatGPTParams = ChatGPTParams {_model = GPT_3_5_turbo_16k, _temperature = Just 1.0} chatMessages = [ ChatMessage {role = System, content = Prompts.systemPrompt}, ChatMessage {role = User, content = planPrompt} diff --git a/waspc/cli/src/Wasp/Cli/Command/Call.hs b/waspc/cli/src/Wasp/Cli/Command/Call.hs index c8d06f331..8e95924f5 100644 --- a/waspc/cli/src/Wasp/Cli/Command/Call.hs +++ b/waspc/cli/src/Wasp/Cli/Command/Call.hs @@ -2,6 +2,7 @@ module Wasp.Cli.Command.Call where data Call = New String -- project name + | AINew | Start | StartDb | Clean diff --git a/waspc/src/Wasp/OpenAI/ChatGPT.hs b/waspc/src/Wasp/OpenAI/ChatGPT.hs index f4cccbb57..5f1a4cef8 100644 --- a/waspc/src/Wasp/OpenAI/ChatGPT.hs +++ b/waspc/src/Wasp/OpenAI/ChatGPT.hs @@ -46,7 +46,7 @@ queryChatGPT apiKey params requestMessages = do data ChatGPTParams = ChatGPTParams { _model :: !Model, - _temperature :: !(Maybe Int) + _temperature :: !(Maybe Float) -- TODO: There are more parameters that chatGPT supports, -- we just didn't add them for now! -- Check https://platform.openai.com/docs/api-reference/completions/create for complete list.