Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/openai_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
GPT_4_1_MINI_2025_04_14_MODEL = "gpt-4.1-mini-2025-04-14"
GPT_4_1_NANO_MODEL = "gpt-4.1-nano"
GPT_4_1_NANO_2025_04_14_MODEL = "gpt-4.1-nano-2025-04-14"
GPT_5_CHAT_LATEST_MODEL = "gpt-5-chat-latest"

# Tuple: (tokens_per_message, tokens_per_name)
MODEL_TOKENS = {
Expand Down Expand Up @@ -59,6 +60,8 @@
GPT_4O_2024_05_13_MODEL: (3, 1),
# GPT-4o mini
GPT_4O_MINI_2024_07_18_MODEL: (3, 1),
# GPT-5 chat latest
GPT_5_CHAT_LATEST_MODEL: (3, 1),
}

# Note that these fallbacks may change over time.
Expand Down
2 changes: 2 additions & 0 deletions app/openai_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
GPT_4_1_MINI_2025_04_14_MODEL,
GPT_4_1_NANO_MODEL,
GPT_4_1_NANO_2025_04_14_MODEL,
GPT_5_CHAT_LATEST_MODEL,
MODEL_TOKENS,
MODEL_FALLBACKS,
)
Expand Down Expand Up @@ -389,6 +390,7 @@ def context_length(
or model == GPT_4_TURBO_2024_04_09_MODEL
or model == GPT_4O_2024_05_13_MODEL
or model == GPT_4O_MINI_2024_07_18_MODEL
or model == GPT_5_CHAT_LATEST_MODEL
):
return 128000
else:
Expand Down
2 changes: 1 addition & 1 deletion app/slack_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def can_send_image_url_to_openai(context: BoltContext) -> bool:
openai_model = context.get("OPENAI_MODEL")
# More supported models will come. This logic will need to be updated then.
can_send_image_url = openai_model is not None and (
openai_model.startswith("gpt-4o") or openai_model.startswith("gpt-4.1")
openai_model.startswith("gpt-4o") or openai_model.startswith("gpt-4.1") or openai_model.startswith("gpt-5")
)
return can_send_image_url

Expand Down
5 changes: 5 additions & 0 deletions app/slack_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
GPT_4O_MINI_MODEL,
GPT_4_1_MODEL,
GPT_4_1_MINI_MODEL,
GPT_5_CHAT_LATEST_MODEL,
)
from app.slack_constants import TIMEOUT_ERROR_MESSAGE, MAX_MESSAGE_LENGTH
from app.slack_ops import extract_state_value
Expand Down Expand Up @@ -434,6 +435,10 @@ def build_configure_modal(context: BoltContext) -> dict:
)

options = [
{
"text": {"type": "plain_text", "text": "GPT-5-chat-latest"},
"value": GPT_5_CHAT_LATEST_MODEL,
},
{
"text": {"type": "plain_text", "text": "GPT-4.1"},
"value": GPT_4_1_MODEL,
Expand Down