From e57b596fd3ecaa6a5b84c220d5421a34f8e1ef66 Mon Sep 17 00:00:00 2001 From: A-Baji Date: Sun, 21 Jul 2024 10:04:07 -0500 Subject: [PATCH 1/3] add gpt4o mini --- discordai/bot/cogs/chatgpt.py | 6 +++--- discordai/bot/cogs/openai.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/discordai/bot/cogs/chatgpt.py b/discordai/bot/cogs/chatgpt.py index 1710bab..a6c98b6 100644 --- a/discordai/bot/cogs/chatgpt.py +++ b/discordai/bot/cogs/chatgpt.py @@ -14,7 +14,7 @@ class ChatGPT(commands.Cog, name="chatgpt"): - models = Literal["gpt-3.5-turbo", "gpt-4o", "gpt-4-turbo"] + models = Literal["gpt-4o-mini", "gpt-3.5-turbo", "gpt-4o", "gpt-4-turbo"] def __init__(self, bot): self.bot = bot @@ -25,7 +25,7 @@ def __init__(self, bot): ) @app_commands.describe( prompt="The prompt to pass in", - model="Listed by cost: Default=gpt-3.5-turbo", + model="Listed by cost: Default=gpt-4o-mini", temp="Number between 0.0 and 2.0. Higher values means more risks: Min=0.0 Max=2.0 Default=1.0", presence_penalty="Number between -2.0 and 2.0. Positive values will encourage new topics: Min=-2.0 Max=2.0 Default=0.0", frequency_penalty="Number between -2.0 and 2.0. Positive values will encourage new words: Min=-2.0 Max=2.0 Default=0.0", @@ -35,7 +35,7 @@ async def chatgpt( self, context: Context, prompt: str, - model: models = "gpt-3.5-turbo", + model: models = "gpt-4o-mini", temp: float = 1.0, presence_penalty: float = 0.0, frequency_penalty: float = 0.0, diff --git a/discordai/bot/cogs/openai.py b/discordai/bot/cogs/openai.py index 6d6c5ca..641f5c3 100644 --- a/discordai/bot/cogs/openai.py +++ b/discordai/bot/cogs/openai.py @@ -14,7 +14,7 @@ class OpenAI(commands.Cog, name="openai"): - models = Literal["gpt-3.5-turbo", "gpt-4o", "gpt-4-turbo"] + models = Literal["gpt-4o-mini", "gpt-3.5-turbo", "gpt-4o", "gpt-4-turbo"] def __init__(self, bot): self.bot = bot @@ -25,7 +25,7 @@ def __init__(self, bot): ) @app_commands.describe( prompt="The prompt to pass in", - model="Listed by cost: Default=gpt-3.5-turbo", + model="Listed by cost: Default=gpt-4o-mini", temp="Number between 0.0 and 2.0. Higher values means more risks: Min=0.0 Max=2.0 Default=1.0", presence_penalty="Number between -2.0 and 2.0. Positive values will encourage new topics: Min=-2.0 Max=2.0 Default=0.0", frequency_penalty="Number between -2.0 and 2.0. Positive values will encourage new words: Min=-2.0 Max=2.0 Default=0.0", @@ -35,7 +35,7 @@ async def openai( self, context: Context, prompt: str, - model: models = "gpt-3.5-turbo", + model: models = "gpt-4o-mini", temp: float = 1.0, presence_penalty: float = 0.0, frequency_penalty: float = 0.0, From 2775430c583126bc9fd98807edc1d64d40abdcb6 Mon Sep 17 00:00:00 2001 From: A-Baji Date: Sun, 21 Jul 2024 10:04:19 -0500 Subject: [PATCH 2/3] 3.1.0 --- CHANGELOG.md | 7 +++++++ discordai/version.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd1029c..cb3604b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention. +## [3.1.0] - 07-21-2024 + +### Added + +- support for the new gpt4o mini model in gpt commands and made it the default model + ## [3.0.2] - 07-16-2024 ### Fixed @@ -125,6 +131,7 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and - modified readme +[3.1.0]: https://github.com/A-Baji/discordAI/compare/3.0.2...3.1.0 [3.0.2]: https://github.com/A-Baji/discordAI/compare/3.0.1...3.0.2 [3.0.1]: https://github.com/A-Baji/discordAI/compare/3.0.0...3.0.1 [3.0.0]: https://github.com/A-Baji/discordAI/compare/2.0.1...3.0.0 diff --git a/discordai/version.py b/discordai/version.py index 131942e..f5f41e5 100644 --- a/discordai/version.py +++ b/discordai/version.py @@ -1 +1 @@ -__version__ = "3.0.2" +__version__ = "3.1.0" From 196e0ab6d2b7ef01ba7ca009fbea9d8b01978905 Mon Sep 17 00:00:00 2001 From: A-Baji Date: Sun, 21 Jul 2024 10:07:25 -0500 Subject: [PATCH 3/3] update tests --- tests/expected_values.py | 122 ++++++++++++++++++++++----------------- 1 file changed, 68 insertions(+), 54 deletions(-) diff --git a/tests/expected_values.py b/tests/expected_values.py index b1e9862..2e5b5bb 100644 --- a/tests/expected_values.py +++ b/tests/expected_values.py @@ -1,31 +1,33 @@ list_module_expected = [ {"id": "dall-e-3", "created": "2023-10-31 20:46:29"}, {"id": "whisper-1", "created": "2023-02-27 21:13:04"}, - {"id": "tts-1", "created": "2023-04-19 21:49:11"}, + {"id": "gpt-4-turbo-2024-04-09", "created": "2024-04-08 18:41:17"}, + {"id": "gpt-4-1106-preview", "created": "2023-11-02 20:33:26"}, {"id": "dall-e-2", "created": "2023-11-01 00:22:57"}, + {"id": "gpt-4-turbo", "created": "2024-04-05 23:57:21"}, {"id": "tts-1-hd-1106", "created": "2023-11-03 23:18:53"}, {"id": "tts-1-hd", "created": "2023-11-03 21:13:35"}, - {"id": "gpt-4-turbo-2024-04-09", "created": "2024-04-08 18:41:17"}, - {"id": "gpt-4-turbo", "created": "2024-04-05 23:57:21"}, - {"id": "gpt-4-0613", "created": "2023-06-12 16:54:56"}, - {"id": "gpt-4o-2024-05-13", "created": "2024-05-10 19:08:52"}, + {"id": "gpt-4-turbo-preview", "created": "2024-01-23 19:22:57"}, + {"id": "tts-1", "created": "2023-04-19 21:49:11"}, + {"id": "babbage-002", "created": "2023-08-21 16:16:55"}, {"id": "gpt-4-0125-preview", "created": "2024-01-23 19:20:12"}, - {"id": "gpt-4", "created": "2023-06-27 16:13:31"}, + {"id": "gpt-4o-2024-05-13", "created": "2024-05-10 19:08:52"}, {"id": "text-embedding-3-small", "created": "2024-01-22 18:43:17"}, - {"id": "gpt-4-turbo-preview", "created": "2024-01-23 19:22:57"}, {"id": "text-embedding-3-large", "created": "2024-01-22 19:53:00"}, - {"id": "babbage-002", "created": "2023-08-21 16:16:55"}, - {"id": "gpt-4-1106-preview", "created": "2023-11-02 20:33:26"}, - {"id": "gpt-3.5-turbo-0125", "created": "2024-01-23 22:19:18"}, {"id": "tts-1-1106", "created": "2023-11-03 23:14:01"}, + {"id": "gpt-4o-mini-2024-07-18", "created": "2024-07-16 23:31:57"}, + {"id": "gpt-4o-mini", "created": "2024-07-16 23:32:21"}, {"id": "gpt-3.5-turbo", "created": "2023-02-28 18:56:42"}, {"id": "gpt-3.5-turbo-instruct", "created": "2023-08-24 18:23:47"}, {"id": "gpt-3.5-turbo-instruct-0914", "created": "2023-09-07 21:34:32"}, - {"id": "gpt-3.5-turbo-1106", "created": "2023-11-02 21:15:48"}, {"id": "text-embedding-ada-002", "created": "2022-12-16 19:01:39"}, {"id": "gpt-3.5-turbo-16k", "created": "2023-05-10 22:35:02"}, {"id": "davinci-002", "created": "2023-08-21 16:11:41"}, + {"id": "gpt-3.5-turbo-0125", "created": "2024-01-23 22:19:18"}, + {"id": "gpt-3.5-turbo-1106", "created": "2023-11-02 21:15:48"}, + {"id": "gpt-4-0613", "created": "2023-06-12 16:54:56"}, {"id": "gpt-4o", "created": "2024-05-10 18:50:49"}, + {"id": "gpt-4", "created": "2023-06-27 16:13:31"}, { "id": "davinci:ft-personal:jason-9582-2022-12-23-05-45-51", "created": "2022-12-23 05:45:51", @@ -282,10 +284,16 @@ "owned_by": "openai-internal", }, { - "id": "tts-1", - "created": "2023-04-19 21:49:11", + "id": "gpt-4-turbo-2024-04-09", + "created": "2024-04-08 18:41:17", "object": "model", - "owned_by": "openai-internal", + "owned_by": "system", + }, + { + "id": "gpt-4-1106-preview", + "created": "2023-11-02 20:33:26", + "object": "model", + "owned_by": "system", }, { "id": "dall-e-2", @@ -294,38 +302,38 @@ "owned_by": "system", }, { - "id": "tts-1-hd-1106", - "created": "2023-11-03 23:18:53", + "id": "gpt-4-turbo", + "created": "2024-04-05 23:57:21", "object": "model", "owned_by": "system", }, { - "id": "tts-1-hd", - "created": "2023-11-03 21:13:35", + "id": "tts-1-hd-1106", + "created": "2023-11-03 23:18:53", "object": "model", "owned_by": "system", }, { - "id": "gpt-4-turbo-2024-04-09", - "created": "2024-04-08 18:41:17", + "id": "tts-1-hd", + "created": "2023-11-03 21:13:35", "object": "model", "owned_by": "system", }, { - "id": "gpt-4-turbo", - "created": "2024-04-05 23:57:21", + "id": "gpt-4-turbo-preview", + "created": "2024-01-23 19:22:57", "object": "model", "owned_by": "system", }, { - "id": "gpt-4-0613", - "created": "2023-06-12 16:54:56", + "id": "tts-1", + "created": "2023-04-19 21:49:11", "object": "model", - "owned_by": "openai", + "owned_by": "openai-internal", }, { - "id": "gpt-4o-2024-05-13", - "created": "2024-05-10 19:08:52", + "id": "babbage-002", + "created": "2023-08-21 16:16:55", "object": "model", "owned_by": "system", }, @@ -336,10 +344,10 @@ "owned_by": "system", }, { - "id": "gpt-4", - "created": "2023-06-27 16:13:31", + "id": "gpt-4o-2024-05-13", + "created": "2024-05-10 19:08:52", "object": "model", - "owned_by": "openai", + "owned_by": "system", }, { "id": "text-embedding-3-small", @@ -347,12 +355,6 @@ "object": "model", "owned_by": "system", }, - { - "id": "gpt-4-turbo-preview", - "created": "2024-01-23 19:22:57", - "object": "model", - "owned_by": "system", - }, { "id": "text-embedding-3-large", "created": "2024-01-22 19:53:00", @@ -360,26 +362,20 @@ "owned_by": "system", }, { - "id": "babbage-002", - "created": "2023-08-21 16:16:55", - "object": "model", - "owned_by": "system", - }, - { - "id": "gpt-4-1106-preview", - "created": "2023-11-02 20:33:26", + "id": "tts-1-1106", + "created": "2023-11-03 23:14:01", "object": "model", "owned_by": "system", }, { - "id": "gpt-3.5-turbo-0125", - "created": "2024-01-23 22:19:18", + "id": "gpt-4o-mini-2024-07-18", + "created": "2024-07-16 23:31:57", "object": "model", "owned_by": "system", }, { - "id": "tts-1-1106", - "created": "2023-11-03 23:14:01", + "id": "gpt-4o-mini", + "created": "2024-07-16 23:32:21", "object": "model", "owned_by": "system", }, @@ -401,12 +397,6 @@ "object": "model", "owned_by": "system", }, - { - "id": "gpt-3.5-turbo-1106", - "created": "2023-11-02 21:15:48", - "object": "model", - "owned_by": "system", - }, { "id": "text-embedding-ada-002", "created": "2022-12-16 19:01:39", @@ -425,12 +415,36 @@ "object": "model", "owned_by": "system", }, + { + "id": "gpt-3.5-turbo-0125", + "created": "2024-01-23 22:19:18", + "object": "model", + "owned_by": "system", + }, + { + "id": "gpt-3.5-turbo-1106", + "created": "2023-11-02 21:15:48", + "object": "model", + "owned_by": "system", + }, + { + "id": "gpt-4-0613", + "created": "2023-06-12 16:54:56", + "object": "model", + "owned_by": "openai", + }, { "id": "gpt-4o", "created": "2024-05-10 18:50:49", "object": "model", "owned_by": "system", }, + { + "id": "gpt-4", + "created": "2023-06-27 16:13:31", + "object": "model", + "owned_by": "openai", + }, { "id": "davinci:ft-personal:jason-9582-2022-12-23-05-45-51", "created": "2022-12-23 05:45:51",