From 06da473aad5bc640cf7120ad8388b8390488bdc9 Mon Sep 17 00:00:00 2001 From: nemoo Date: Fri, 26 Jul 2024 11:24:28 +0200 Subject: [PATCH] Support gpt-4o-mini Use gpt-4o-mini as default in README Add info about CustomChatCompletionModel in ChatGPT section --- README.md | 5 +++-- .../openai/requests/completions/chat/ChatRequestBody.scala | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9c0fa78b..ec13321c 100644 --- a/README.md +++ b/README.md @@ -52,8 +52,9 @@ object Main extends App { ) ) + // use ChatCompletionModel.CustomChatCompletionModel("gpt-some-future-version") for models not yet supported here val chatRequestBody: ChatBody = ChatBody( - model = ChatCompletionModel.GPT35Turbo, + model = ChatCompletionModel.GPT4oMini, messages = bodyMessages ) @@ -66,7 +67,7 @@ object Main extends App { ChatResponse( chatcmpl-79shQITCiqTHFlI9tgElqcbMTJCLZ,chat.completion, 1682589572, - gpt-3.5-turbo-0301, + gpt-4o-mini, Usage(10,10,20), List( Choices( diff --git a/core/src/main/scala/sttp/openai/requests/completions/chat/ChatRequestBody.scala b/core/src/main/scala/sttp/openai/requests/completions/chat/ChatRequestBody.scala index 1d312127..1f8a8198 100644 --- a/core/src/main/scala/sttp/openai/requests/completions/chat/ChatRequestBody.scala +++ b/core/src/main/scala/sttp/openai/requests/completions/chat/ChatRequestBody.scala @@ -143,6 +143,8 @@ object ChatRequestBody { case object GPT4o extends ChatCompletionModel("gpt-4o") + case object GPT4oMini extends ChatCompletionModel("gpt-4o-mini") + case class CustomChatCompletionModel(customChatCompletionModel: String) extends ChatCompletionModel(customChatCompletionModel) val values: Set[ChatCompletionModel] = @@ -155,7 +157,8 @@ object ChatRequestBody { GPT35Turbo0301, GPT4Turbo, GPT4TurboVision, - GPT4o + GPT4o, + GPT4oMini ) private val byChatModelValue = values.map(model => model.value -> model).toMap