Skip to content

Commit ec5c603

Browse files
committed
[共通] OpenAI::Chat / Vision のデフォルトモデルを GPT-4o に #1234
1 parent 0c576d4 commit ec5c603

File tree

2 files changed

+12
-21
lines changed

2 files changed

+12
-21
lines changed

Siv3D/include/Siv3D/OpenAI/Chat.hpp

+10-19
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,17 @@ namespace s3d
2323
{
2424
namespace Model
2525
{
26-
/// @brief GPT-3.5
26+
/// @brief GPT-3.5 16K
2727
/// @see https://platform.openai.com/docs/models/gpt-3-5
28-
/// @remark alias: `GPT3_5_Turbo_16K_1106` from February 2024 16th
2928
inline constexpr char32 GPT3_5_Turbo[] = U"gpt-3.5-turbo";
3029

31-
/// @brief GPT-3.5 16K (0125)
32-
/// @see https://platform.openai.com/docs/models/gpt-3-5
33-
inline constexpr char32 GPT3_5_Turbo_16K_0125[] = U"gpt-3.5-turbo-0125";
34-
35-
/// @brief GPT-4 8K
36-
/// @see https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo
37-
inline constexpr char32 GPT4[] = U"gpt-4";
38-
39-
/// @brief GPT-4 32K
30+
/// @brief GPT-4 Turbo 128K
4031
/// @see https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo
41-
inline constexpr char32 GPT4_32K[] = U"gpt-4-32k";
32+
inline constexpr char32 GPT4_Turbo[] = U"gpt-4-turbo";
4233

43-
/// @brief latest GPT-4 Turbo preview
34+
/// @brief GPT-4o 128K
4435
/// @see https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo
45-
inline constexpr char32 GPT4_Turbo_Preview[] = U"gpt-4-turbo-preview";
36+
inline constexpr char32 GPT4o[] = U"gpt-4o";
4637
}
4738

4839
/// @brief メッセージのロール | Message role
@@ -84,7 +75,7 @@ namespace s3d
8475
Array<std::pair<Role, String>> messages;
8576

8677
/// @brief モデル | Model
87-
String model = Model::GPT3_5_Turbo;
78+
String model = Model::GPT4o;
8879

8980
/// @brief レスポンスのフォーマット | Response format
9081
/// @remark `ResponseFormat::JSON` を指定した場合、メッセージには "JSON" という言葉を含める必要があります。 | If `ResponseFormat::JSON` is specified, the message must contain the word "JSON".
@@ -98,11 +89,11 @@ namespace s3d
9889
/// @brief ChatGPT にメッセージを送り、その返答メッセージを取得します。 | Sends a message to ChatGPT and retrieves the response message.
9990
/// @param apiKey OpenAI API キー | OpenAI API key
10091
/// @param message メッセージ | Message
101-
/// @param model 使用するモデル | The model to be used (default: Model::GPT3_5_Turbo)
92+
/// @param model 使用するモデル | The model to be used (default: Model::GPT4o)
10293
/// @return 返答メッセージ。取得に失敗した場合は空の文字列 | Response message. An empty string if the retrieval fails.
10394
/// @remark インターネットアクセスが必要です。 | Internet access is required.
10495
[[nodiscard]]
105-
String Complete(StringView apiKey, StringView message, StringView model = Model::GPT3_5_Turbo);
96+
String Complete(StringView apiKey, StringView message, StringView model = Model::GPT4o);
10697

10798
/// @brief ChatGPT にメッセージを送り、その返答メッセージを取得します。 | Sends messages to ChatGPT and retrieves the response message.
10899
/// @param apiKey OpenAI API キー | OpenAI API key
@@ -124,12 +115,12 @@ namespace s3d
124115
/// @brief ChatGPT にメッセージを送り、レスポンス(JSON)を取得する非同期タスクを返します。 | Returns an asynchronous task for sending a message to ChatGPT and retrieving the response (JSON).
125116
/// @param apiKey OpenAI API キー | OpenAI API key
126117
/// @param message メッセージ | Message
127-
/// @param model 使用するモデル | The model to be used (default: Model::GPT3_5_Turbo)
118+
/// @param model 使用するモデル | The model to be used (default: Model::GPT4o)
128119
/// @return 非同期タスク | Asynchronous task
129120
/// @remark 戻り値の task が `(task.isReady() == true) && (task.getResponse().isOK() == true)` になれば結果を取得できます。 | The result can be retrieved if `(task.isReady() == true) && (task.getResponse().isOK() == true)`.
130121
/// @remark インターネットアクセスが必要です。 | Internet access is required.
131122
[[nodiscard]]
132-
AsyncHTTPTask CompleteAsync(StringView apiKey, StringView message, StringView model = Model::GPT3_5_Turbo);
123+
AsyncHTTPTask CompleteAsync(StringView apiKey, StringView message, StringView model = Model::GPT4o);
133124

134125
/// @brief ChatGPT にメッセージを送り、レスポンス(JSON)を取得する非同期タスクを返します。 | Returns an asynchronous task for sending messages to ChatGPT and retrieving the response (JSON).
135126
/// @param apiKey OpenAI API キー | OpenAI API key

Siv3D/include/Siv3D/OpenAI/Vision.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace s3d
2828
{
2929
/// @brief GPT-4 Turbo with vision 128K
3030
/// @see https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo
31-
inline constexpr char32 GPT4V_Turbo_128K_Preview[] = U"gpt-4-vision-preview";
31+
inline constexpr char32 GPT4o[] = U"gpt-4o";
3232
}
3333

3434
/// @brief 画像データ | Image data
@@ -78,7 +78,7 @@ namespace s3d
7878
Array<ImageData> images;
7979

8080
/// @brief モデル | Model
81-
String model = Model::GPT4V_Turbo_128K_Preview;
81+
String model = Model::GPT4o;
8282

8383
/// @brief 最大トークン数 | Maximum number of tokens
8484
int32 maxTokens = 600;

0 commit comments

Comments
 (0)