Skip to content

Commit d743b7b

Browse files
authored

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

src/Bridge/OpenAI/GPT.php

+28-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,32 @@ final class GPT implements LanguageModel
2020
public const O3_MINI = 'o3-mini';
2121
public const O3_MINI_HIGH = 'o3-mini-high';
2222
public const GPT_45_PREVIEW = 'gpt-4.5-preview';
23+
public const GPT_41 = 'gpt-4.1';
24+
public const GPT_41_MINI = 'gpt-4.1-mini';
25+
public const GPT_41_NANO = 'gpt-4.1-nano';
26+
27+
private const IMAGE_SUPPORTING = [
28+
self::GPT_4_TURBO,
29+
self::GPT_4O,
30+
self::GPT_4O_MINI,
31+
self::O1_MINI,
32+
self::O1_PREVIEW,
33+
self::O3_MINI,
34+
self::GPT_45_PREVIEW,
35+
self::GPT_41,
36+
self::GPT_41_MINI,
37+
self::GPT_41_NANO,
38+
];
39+
40+
private const STRUCTURED_OUTPUT_SUPPORTING = [
41+
self::GPT_4O,
42+
self::GPT_4O_MINI,
43+
self::O3_MINI,
44+
self::GPT_45_PREVIEW,
45+
self::GPT_41,
46+
self::GPT_41_MINI,
47+
self::GPT_41_NANO,
48+
];
2349

2450
/**
2551
* @param array<mixed> $options The default options for the model usage
@@ -36,11 +62,11 @@ public function __construct(
3662
}
3763

3864
if (false === $this->supportsImageInput) {
39-
$this->supportsImageInput = in_array($this->name, [self::GPT_4_TURBO, self::GPT_4O, self::GPT_4O_MINI, self::O1_MINI, self::O1_PREVIEW, self::O3_MINI, self::GPT_45_PREVIEW], true);
65+
$this->supportsImageInput = in_array($this->name, self::IMAGE_SUPPORTING, true);
4066
}
4167

4268
if (false === $this->supportsStructuredOutput) {
43-
$this->supportsStructuredOutput = in_array($this->name, [self::GPT_4O, self::GPT_4O_MINI, self::O3_MINI, self::GPT_45_PREVIEW], true);
69+
$this->supportsStructuredOutput = in_array($this->name, self::STRUCTURED_OUTPUT_SUPPORTING, true);
4470
}
4571
}
4672

0 commit comments

Comments
 (0)