Migrate the OpenAI model constants to the OpenAI Java SDK
ProprietarySpring AI 2.0 removed OpenAiApi.ChatModel, OpenAiApi.EmbeddingModel and OpenAiImageApi.ImageModel, as its OpenAI models now use the OpenAI Java SDK. This replaces their constants with those of the SDK's ChatModel, EmbeddingModel and ImageModel that name the same model, such as OpenAiApi.ChatModel.GPT_4_O with ChatModel.GPT_4O, getValue() on them with asString(), and OpenAiChatOptions.builder().model(OpenAiApi.ChatModel.GPT_4_O) with model(ChatModel.GPT_4O.asString()). Where the SDK has no constant for the model, such as O1_PRO, its name is used as a string instead of getValue(), and a reference to the constant itself is left for review.
io. moderne. java. spring. ai2. MigrateOpenAiModelConstantsmod run . --recipe= io. moderne. java. spring. ai2. MigrateOpenAiModelConstantsInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.