Planing working relatively ok!

This commit is contained in:
Martin Sosic 2023-06-14 23:05:18 +02:00
parent dcb633a557
commit c57ef72117
4 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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}

View File

@ -2,6 +2,7 @@ module Wasp.Cli.Command.Call where
data Call
= New String -- project name
| AINew
| Start
| StartDb
| Clean

View File

@ -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.