mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-12-26 10:35:04 +03:00
Improved messaging for missing OpenAI Api key.
This commit is contained in:
parent
d3454a5f58
commit
83ef006a98
@ -102,8 +102,14 @@ getOpenAIApiKey =
|
||||
throwMissingOpenAIApiKeyEnvVarError =
|
||||
throwError $
|
||||
CommandError
|
||||
"Missing OPENAI_API_KEY env var"
|
||||
"You can obtain this key from your OpenAI profile."
|
||||
"Missing OPENAI_API_KEY environment variable"
|
||||
$ unlines
|
||||
[ "Wasp AI uses ChatGPT to generate your project, and therefore requires you to provide it with an OpenAI API key.",
|
||||
"You can obtain this key via your OpenAI account's user settings (https://platform.openai.com/account/api-keys).",
|
||||
"Then, add",
|
||||
" export OPENAI_API_KEY=<yourkeyhere>",
|
||||
"to .bash_profile or .profile, restart your shell, and you should be good to go."
|
||||
]
|
||||
|
||||
newProjectDetails :: String -> String -> NewProjectDetails
|
||||
newProjectDetails webAppName webAppDescription =
|
||||
|
@ -10,7 +10,6 @@ where
|
||||
|
||||
import Data.Aeson (FromJSON)
|
||||
import Data.List (isPrefixOf)
|
||||
import Data.Maybe (fromMaybe)
|
||||
import qualified Data.Text as T
|
||||
import GHC.Generics (Generic)
|
||||
import NeatInterpolation (trimming)
|
||||
@ -180,16 +179,16 @@ instance Show OperationType where
|
||||
show Query = "query"
|
||||
|
||||
data Operation = Operation
|
||||
{ opImpl :: OperationImpl,
|
||||
opPlan :: Plan.Operation,
|
||||
opType :: OperationType
|
||||
{ opImpl :: !OperationImpl,
|
||||
opPlan :: !Plan.Operation,
|
||||
opType :: !OperationType
|
||||
}
|
||||
deriving (Show)
|
||||
|
||||
data OperationImpl = OperationImpl
|
||||
{ opWaspDecl :: String,
|
||||
opJsImpl :: String,
|
||||
opJsImports :: Maybe String
|
||||
{ opWaspDecl :: !String,
|
||||
opJsImpl :: !String,
|
||||
opJsImports :: !(Maybe String)
|
||||
}
|
||||
deriving (Generic, Show)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user