File tree Expand file tree Collapse file tree 4 files changed +8
-15
lines changed
main/scala/io/cequence/openaiscala/anthropic/service
test/scala/io/cequence/openaiscala/anthropic/service/impl
openai-client/src/test/scala/io/cequence/openaiscala/service Expand file tree Collapse file tree 4 files changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ import scala.concurrent.ExecutionContext
1717 */
1818object AnthropicServiceFactory extends AnthropicServiceConsts {
1919
20- private val apiVersion = " 2023-06-01"
21- private val envAPIKey = " ANTHROPIC_API_KEY"
20+ private def apiVersion = " 2023-06-01"
21+ private def envAPIKey = " ANTHROPIC_API_KEY"
2222
2323 /**
2424 * Create a new instance of the [[OpenAIChatCompletionService ]] wrapping the AnthropicService
Original file line number Diff line number Diff line change @@ -6,13 +6,12 @@ import io.cequence.openaiscala.anthropic.domain.Message.UserMessage
66import io .cequence .openaiscala .anthropic .domain .settings .AnthropicCreateMessageSettings
77import io .cequence .openaiscala .anthropic .service ._
88import io .cequence .openaiscala .domain .NonOpenAIModelId
9- import org .scalamock .scalatest .AsyncMockFactory
109import org .scalatest .GivenWhenThen
1110import org .scalatest .wordspec .AsyncWordSpec
1211
1312import scala .concurrent .ExecutionContext
1413
15- class AnthropicServiceSpec extends AsyncWordSpec with GivenWhenThen with AsyncMockFactory {
14+ class AnthropicServiceSpec extends AsyncWordSpec with GivenWhenThen {
1615
1716 implicit val ec : ExecutionContext = ExecutionContext .global
1817 implicit val materializer : Materializer = Materializer (ActorSystem ())
Original file line number Diff line number Diff line change @@ -4,8 +4,6 @@ import akka.actor.ActorSystem
44import akka .stream .Materializer
55import io .cequence .openaiscala .anthropic .service .AnthropicServiceFactory
66import io .cequence .wsclient .domain .WsRequestContext
7- import io .cequence .wsclient .service .ws .Timeouts
8- import org .scalamock .scalatest .MockFactory
97import org .scalatest .PrivateMethodTester .{PrivateMethod , _ }
108import play .api .libs .ws .StandaloneWSRequest
119import play .api .libs .ws .ahc .StandaloneAhcWSResponse
@@ -61,9 +59,9 @@ class AnthropicServiceClassImpl(
6159) extends AnthropicServiceImpl {}
6260
6361object TestFactory {
64- val getAPIKeyFromEnv = PrivateMethod [String ](' getAPIKeyFromEnv )
65- val apiVersionMethod = PrivateMethod [String ](' apiVersion )
66- val defaultCoreUrlMethod = PrivateMethod [String ](' defaultCoreUrl )
62+ val getAPIKeyFromEnv = PrivateMethod [String ](Symbol ( " getAPIKeyFromEnv" ) )
63+ val apiVersionMethod = PrivateMethod [String ](Symbol ( " apiVersion" ) )
64+ val defaultCoreUrlMethod = PrivateMethod [String ](Symbol ( " defaultCoreUrl" ) )
6765
6866 val factory = AnthropicServiceFactory
6967 val apiKey = factory invokePrivate getAPIKeyFromEnv()
Original file line number Diff line number Diff line change 11package io .cequence .openaiscala .service
22
3- import io .cequence .openaiscala .domain .UserMessage
43import io .cequence .openaiscala ._
4+ import io .cequence .openaiscala .domain .UserMessage
55import io .cequence .openaiscala .service .impl .TestFactory
6- import org .scalamock .scalatest .AsyncMockFactory
76import org .scalatest .GivenWhenThen
87import org .scalatest .wordspec .AsyncWordSpec
98
10- class HandleOpenAIErrorCodesSpec
11- extends AsyncWordSpec
12- with GivenWhenThen
13- with AsyncMockFactory {
9+ class HandleOpenAIErrorCodesSpec extends AsyncWordSpec with GivenWhenThen {
1410
1511 private val irrelevantMessages = Seq (UserMessage (" Hello" ))
1612
You can’t perform that action at this time.
0 commit comments