softwaremill / sttp-openai

Apache License 2.0
41 stars 9 forks source link

Current models like Gpt4o-mini are not supported. #187

Closed nemoo closed 2 months ago

nemoo commented 2 months ago

Current models like Gpt4o-mini are not supported. And since ChatCompletionModel is a sealed class it seems that I cannot even create a ChatCompletionModel("gpt-4o-mini") on the fly?

https://github.com/softwaremill/sttp-openai/blob/5492e74c8d5a0e5ed372891c0193be83aac7ee4c/core/src/main/scala/sttp/openai/requests/completions/chat/ChatRequestBody.scala#L113

benzwreck commented 2 months ago

I guess https://github.com/softwaremill/sttp-openai/blob/5492e74c8d5a0e5ed372891c0193be83aac7ee4c/core/src/main/scala/sttp/openai/requests/completions/chat/ChatRequestBody.scala#L146 is something you're looking for.

nemoo commented 2 months ago

@benzwreck ah yes, thanks!

Using model = ChatCompletionModel.CustomChatCompletionModel("gpt-4o-mini") works for me until the next release.

adamw commented 2 months ago

@nemoo maybe you could create a PR which would update the constants that we have? Maybe we should amend the docs as well to cover this :)

nemoo commented 2 months ago

@adamw sure, I will provide a PR

nemoo commented 2 months ago

PR for the new model and hint in docs: https://github.com/softwaremill/sttp-openai/pull/189

I was not able to test it though, because I cannot get the sbt build to run under Windows unfortunately.

nemoo commented 2 months ago

merged and available as of release 0.2.1