Skip to content

Commit

Permalink
Enable new OpenAI models for MAGE
Browse files Browse the repository at this point in the history
  • Loading branch information
jankovidakovic committed Nov 30, 2023
1 parent 3825ef9 commit 745a02e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion waspc/src/Wasp/AI/OpenAI/ChatGPT.hs
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,30 @@ data ChatGPTParams = ChatGPTParams
deriving (Show)

-- TODO: There are some more data models there but for now we went with these core ones.
data Model = GPT_3_5_turbo | GPT_3_5_turbo_16k | GPT_4
data Model
= GPT_3_5_turbo_1106
| GPT_3_5_turbo
| GPT_3_5_turbo_16k
| GPT_4_1106_Preview
| GPT_4
| GPT_4_32k
| GPT_4_0613
| GPT_4_32k_0613
deriving (Eq, Bounded, Enum)

instance Show Model where
show = modelOpenAiId

modelOpenAiId :: Model -> String
modelOpenAiId = \case
GPT_3_5_turbo_1106 -> "gpt-3.5-turbo-1106"
GPT_3_5_turbo -> "gpt-3.5-turbo"
GPT_3_5_turbo_16k -> "gpt-3.5-turbo-16k"
GPT_4_1106_Preview -> "gpt-4-1106-preview"
GPT_4 -> "gpt-4"
GPT_4_32k -> "gpt-4-32k"
GPT_4_0613 -> "gpt-4-0613"
GPT_4_32k_0613 -> "gpt-4-32k-0613"

instance FromJSON Model where
parseJSON = Aeson.withText "Model" $ \t ->
Expand Down

0 comments on commit 745a02e

Please sign in to comment.