-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding test task for Postgres PGVectorStore (#509)
* adding test task * Bugs fixed on PGVectorStoreSpec * VectorSize for OpenAI by default on PGPostgreStore --------- Co-authored-by: Javi Pacheco <javi.pacheco@gmail.com>
- Loading branch information
1 parent
d164266
commit 122bf81
Showing
6 changed files
with
42 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,3 +51,7 @@ tasks { | |
|
||
withType<AbstractPublishToMaven> { dependsOn(withType<Sign>()) } | ||
} | ||
|
||
tasks.test{ | ||
useJUnitPlatform() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package xef | ||
|
||
import arrow.atomic.AtomicInt | ||
import com.xebia.functional.xef.llm.models.chat.Message | ||
import com.xebia.functional.xef.llm.models.chat.Role | ||
import com.xebia.functional.xef.store.ConversationId | ||
import com.xebia.functional.xef.store.Memory | ||
|
||
class MemoryData { | ||
val defaultConversationId = ConversationId("default-id") | ||
|
||
val atomicInt = AtomicInt(0) | ||
|
||
fun generateRandomMessages( | ||
n: Int, | ||
append: String? = null, | ||
conversationId: ConversationId = defaultConversationId | ||
): List<Memory> = | ||
(0 until n).flatMap { | ||
val m1 = Message(Role.USER, "Question $it${append?.let { ": $it" } ?: ""}", Role.USER.toString().lowercase()) | ||
val m2 = Message(Role.ASSISTANT, "Response $it${append?.let { ": $it" } ?: ""}", Role.ASSISTANT.toString().lowercase()) | ||
listOf( | ||
Memory(conversationId, m1, atomicInt.addAndGet(1)), | ||
Memory(conversationId, m2, atomicInt.addAndGet(1)), | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters