Skip to content

Commit 7359614

Browse files
committed
Default openai_ask to gpt-4.1
1 parent 1e9c94c commit 7359614

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ _None_
1818

1919
### Internal Changes
2020

21-
- `openai_ask`: validate named function tools, use `max_completion_tokens`, and opt out of OpenAI request storage. [#719]
21+
- `openai_ask`: validate named function tools, default to `gpt-4.1`, use `max_completion_tokens`, and opt out of OpenAI request storage. [#719]
2222

2323
## 14.5.0
2424

lib/fastlane/plugin/wpmreleasetoolkit/actions/common/openai_ask_action.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class OpenaiAskAction < Action
1111
# Preserve the previous `max_tokens` ceiling while using the current API field.
1212
DEFAULT_MAX_COMPLETION_TOKENS = 2048
1313
DEFAULT_MAX_TOOL_ITERATIONS = 5
14-
DEFAULT_MODEL = 'gpt-4o'
14+
DEFAULT_MODEL = 'gpt-4.1'
1515

1616
PREDEFINED_PROMPTS = {
1717
release_notes: <<~PROMPT
@@ -396,7 +396,7 @@ def self.available_options
396396
sensitive: true,
397397
type: String),
398398
FastlaneCore::ConfigItem.new(key: :model,
399-
description: 'The OpenAI model to send the request to (e.g. `gpt-4o`, `gpt-4o-mini`, `gpt-4.1`). ' \
399+
description: 'The OpenAI model to send the request to (e.g. `gpt-4.1`, `gpt-4.1-mini`, `gpt-4o`). ' \
400400
"Defaults to `#{DEFAULT_MODEL}`",
401401
optional: true,
402402
default_value: DEFAULT_MODEL,

spec/openai_ask_action_spec.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def stubbed_response(text)
1212
"id": "chatcmpl-Aa2NPY4sSWF5eKoW1aFBJmfc78y9p",
1313
"object": "chat.completion",
1414
"created": 1733152307,
15-
"model": "gpt-4o-2024-08-06",
15+
"model": "gpt-4.1-2025-04-14",
1616
"choices": [
1717
{
1818
"index": 0,
@@ -51,7 +51,7 @@ def stubbed_tool_call_response(tool_call_id:, name:, arguments_json:)
5151
id: 'chatcmpl-toolcall',
5252
object: 'chat.completion',
5353
created: 1_733_152_308,
54-
model: 'gpt-4o-2024-08-06',
54+
model: 'gpt-4.1-2025-04-14',
5555
choices: [
5656
{
5757
index: 0,
@@ -159,6 +159,12 @@ def run_test(prompt_param:, question_param:, expected_prompt:, expected_response
159159
expect(body).not_to have_key('max_tokens')
160160
end
161161

162+
it 'uses gpt-4.1 as the default model' do
163+
body = JSON.parse(described_class.request_body(prompt: 'sys', question: 'q'))
164+
165+
expect(body['model']).to eq('gpt-4.1')
166+
end
167+
162168
it 'opts out of storing Chat Completions by default' do
163169
body = JSON.parse(described_class.request_body(prompt: 'sys', question: 'q'))
164170

0 commit comments

Comments
 (0)