|
1 | 1 | package com.xebia.functional.chains
|
2 | 2 |
|
3 | 3 | import arrow.core.raise.either
|
4 |
| -import com.xebia.functional.llm.openai.CompletionChoice |
5 |
| -import com.xebia.functional.llm.openai.CompletionRequest |
6 |
| -import com.xebia.functional.llm.openai.EmbeddingRequest |
7 |
| -import com.xebia.functional.llm.openai.EmbeddingResult |
8 |
| -import com.xebia.functional.llm.openai.OpenAIClient |
9 | 4 | import com.xebia.functional.prompt.PromptTemplate
|
10 | 5 | import io.kotest.assertions.arrow.core.shouldBeLeft
|
11 | 6 | import io.kotest.assertions.arrow.core.shouldBeRight
|
@@ -63,20 +58,3 @@ class LLMChainSpec : StringSpec({
|
63 | 58 | } shouldBeLeft Chain.InvalidInputs("The expected inputs are more than one: {name}, {age}")
|
64 | 59 | }
|
65 | 60 | })
|
66 |
| - |
67 |
| -val llm = object : OpenAIClient { |
68 |
| - override suspend fun createCompletion(request: CompletionRequest): List<CompletionChoice> = |
69 |
| - when(request.prompt) { |
70 |
| - "Tell me a joke." -> |
71 |
| - listOf(CompletionChoice("I'm not good at jokes", 1, "foo")) |
72 |
| - "My name is foo and I'm 28 years old" -> |
73 |
| - listOf(CompletionChoice("Hello there! Nice to meet you foo", 1, "foo")) |
74 |
| - else -> listOf(CompletionChoice("foo", 1, "bar")) |
75 |
| - } |
76 |
| - |
77 |
| - override suspend fun createChatCompletion(request: ChatCompletionRequest): ChatCompletionResponse { |
78 |
| - TODO("Not yet implemented") |
79 |
| - } |
80 |
| - |
81 |
| - override suspend fun createEmbeddings(request: EmbeddingRequest): EmbeddingResult = TODO() |
82 |
| -} |
0 commit comments