File tree 2 files changed +17
-0
lines changed
core/src/commonMain/kotlin/com/xebia/functional/xef/llm/models/embeddings
scala/src/test/scala/com/xebia/functional/xef/llm/models/embeddings
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 1
1
package com.xebia.functional.xef.llm.models.embeddings
2
2
3
3
import kotlin.jvm.JvmInline
4
+ import kotlin.jvm.JvmStatic
4
5
5
6
data class RequestConfig (val model : EmbeddingModel , val user : User ) {
6
7
companion object {
8
+ @JvmStatic
9
+ fun apply (model : EmbeddingModel , userId : String ): RequestConfig {
10
+ return RequestConfig (model, User (userId))
11
+ }
12
+
7
13
@JvmInline value class User (val id : String )
8
14
}
9
15
}
Original file line number Diff line number Diff line change
1
+ package com .xebia .functional .xef .llm .models .embeddings
2
+
3
+ import munit .FunSuite
4
+
5
+ class RequestConfigSpec extends FunSuite :
6
+
7
+ test(" Should create a RequestConfig through the static apply method" ) {
8
+ val requestConfig = RequestConfig (EmbeddingModel .TEXT_EMBEDDING_ADA_002 , " user" )
9
+
10
+ assertEquals(requestConfig.getModel, EmbeddingModel .TEXT_EMBEDDING_ADA_002 )
11
+ }
You can’t perform that action at this time.
0 commit comments