simon.vergauwen
05/29/2024, 12:57 PMsimon.vergauwen
05/29/2024, 12:59 PMsealed interface CreateChatCompletionRequestModel {
val value: String
data class Custom(override val value: String) : CreateChatCompletionRequestModel
enum class Enum(override val value: String) : CreateChatCompletionRequestModel {
Gpt_4_0125_Preview("gpt-4-0125-preview"),
Gpt_4_Turbo_Preview("gpt-4-turbo-preview"),
Gpt_4_Turbo_1106_Preview("gpt-4-1106-preview");
}
}
Any better suggestions?Sam
05/29/2024, 12:59 PMsimon.vergauwen
05/29/2024, 1:00 PMsimon.vergauwen
05/29/2024, 1:00 PManyOf
which only exists out of an open enumeration.Sam
05/29/2024, 1:01 PM@JvmInline value class HttpStatus(val code: Int) {
companion object {
val Ok = HttpStatus(200)
// etc
}
}
Sam
05/29/2024, 1:01 PMSam
05/29/2024, 1:02 PMHttpStatus.Ok == HttpStatus(200)
, which is the important thingsimon.vergauwen
05/29/2024, 1:02 PMsimon.vergauwen
05/29/2024, 1:03 PMEmil Kantis
05/29/2024, 1:32 PMsimon.vergauwen
05/29/2024, 1:37 PMEmil Kantis
05/29/2024, 1:41 PMsimon.vergauwen
05/29/2024, 1:43 PMEmil Kantis
05/29/2024, 1:45 PMsimon.vergauwen
05/29/2024, 1:50 PMsimon.vergauwen
05/29/2024, 1:50 PMchristophsturm
05/30/2024, 6:18 AMIβve found it to work really well! My use case was this:
```@JvmInline value class HttpStatus(val code: Int) {
companion object {
val Ok = HttpStatus(200)
// etc
}
}```
is that from a http client or server? maybe open source?
simon.vergauwen
05/30/2024, 6:19 AMchristophsturm
05/30/2024, 6:20 AMSam
05/30/2024, 7:40 AMsimon.vergauwen
05/30/2024, 8:14 AMSam
05/30/2024, 8:26 AMsimon.vergauwen
05/30/2024, 8:28 AMWe were having a lot of odd networking/performance problems, and there was some evidence that they might be partly coming from Ktor itself.I've heard this several times before, both on client and server π
Sam
05/30/2024, 8:28 AMsimon.vergauwen
05/30/2024, 8:30 AMSam
05/30/2024, 8:31 AMsimon.vergauwen
05/30/2024, 8:32 AMchristophsturm
05/30/2024, 8:43 AMSam
05/30/2024, 8:45 AMSam
05/30/2024, 8:46 AMSam
05/30/2024, 8:48 AMchristophsturm
05/30/2024, 8:50 AMchristophsturm
05/30/2024, 8:51 AM