Skip to content

Commit e1bc352

Browse files
authored
Assistant - support new 4.1 models
1 parent d9b9184 commit e1bc352

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

assistant/assistant.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class Assistant(
5454
"""
5555

5656
__author__ = "[vertyco](https://github.com/vertyco/vrt-cogs)"
57-
__version__ = "6.12.21"
57+
__version__ = "6.12.22"
5858

5959
def format_help_for_context(self, ctx):
6060
helpcmd = super().format_help_for_context(ctx)

assistant/common/api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ async def count_function_tokens(self, functions: List[dict], model: str = "gpt-4
170170
"gpt-4o-2024-11-20",
171171
"gpt-4o-mini",
172172
"gpt-4o-mini-2024-07-18",
173+
"gpt-4.1",
174+
"gpt-4.1-mini",
175+
"gpt-4.1-nano",
173176
"o1-preview",
174177
"o1-preview-2024-09-12",
175178
"o1",

assistant/common/constants.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
"gpt-4o-2024-08-06": 128000,
2222
"gpt-4o-2024-11-20": 128000,
2323
"chatgpt-4o-latest": 128000,
24+
"gpt-4.1": 1047576,
25+
"gpt-4.1-mini": 1047576,
26+
"gpt-4.1-nano": 1047576,
2427
"o1": 128000,
2528
"o1-2024-12-17": 200000,
2629
"o1-preview": 128000,
@@ -60,6 +63,9 @@
6063
"chatgpt-4o-latest": [0.0025, 0.01],
6164
"gpt-4o-mini": [0.00015, 0.0006],
6265
"gpt-4o-mini-2024-07-18": [0.00015, 0.0006],
66+
"gpt-4.1": [0.002, 0.008],
67+
"gpt-4.1-mini": [0.0004, 0.0016],
68+
"gpt-4.1-nano": [0.0001, 0.0004],
6369
"o1": [0.015, 0.06],
6470
"o1-2024-12-17": [0.015, 0.06],
6571
"o1-preview": [0.015, 0.06],
@@ -105,6 +111,9 @@
105111
"gpt-4o-mini-2024-07-18",
106112
"gpt-4o-2024-08-06",
107113
"chatgpt-4o-latest",
114+
"gpt-4.1",
115+
"gpt-4.1-mini",
116+
"gpt-4.1-nano",
108117
]
109118
NO_DEVELOPER_ROLE = [ # Also doesnt support system messages
110119
"o1-mini",
@@ -125,6 +134,9 @@
125134
"gpt-4o-mini-2024-07-18",
126135
"gpt-4o-2024-08-06",
127136
"chatgpt-4o-latest",
137+
"gpt-4.1",
138+
"gpt-4.1-mini",
139+
"gpt-4.1-nano",
128140
"o1",
129141
"o1-2024-12-17",
130142
# "o3-mini",
@@ -146,6 +158,9 @@
146158
"gpt-4o-mini-2024-07-18",
147159
"gpt-4o-2024-08-06",
148160
"chatgpt-4o-latest",
161+
"gpt-4.1",
162+
"gpt-4.1-mini",
163+
"gpt-4.1-nano",
149164
"o1",
150165
"o1-2024-12-17",
151166
"o3-mini",

0 commit comments

Comments
 (0)