From 1526674700519ee130447ef8e1b19df05869fe97 Mon Sep 17 00:00:00 2001 From: peterbanda Date: Tue, 14 Nov 2023 23:37:03 +0100 Subject: [PATCH] Formatting --- .../openaiscala/MessageJsonSpec.scala | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/openai-client/src/test/scala/io/cequence/openaiscala/MessageJsonSpec.scala b/openai-client/src/test/scala/io/cequence/openaiscala/MessageJsonSpec.scala index 40f69889..51fae278 100644 --- a/openai-client/src/test/scala/io/cequence/openaiscala/MessageJsonSpec.scala +++ b/openai-client/src/test/scala/io/cequence/openaiscala/MessageJsonSpec.scala @@ -233,7 +233,8 @@ class MessageJsonSpec extends Matchers with AnyWordSpecLike { arguments = "{\n \"location\": \"Boston, MA\"\n}" ) - val message = AssistantToolMessage(tool_calls = Seq(("get_current_weather_1", toolCallSpec))) + val message = + AssistantToolMessage(tool_calls = Seq(("get_current_weather_1", toolCallSpec))) val json = toJson(message) val jsonKeys = json.keySet @@ -245,13 +246,18 @@ class MessageJsonSpec extends Matchers with AnyWordSpecLike { json("role") shouldBe JsString("assistant") json("tool_calls").asOpt[JsArray] shouldBe defined - json("tool_calls") shouldBe JsArray(Seq( - Json.obj( - "id" -> JsString(toolId), - "type" -> JsString("function"), - "function" -> Json.obj("name" -> JsString(toolCallSpec.name), "arguments" -> JsString(toolCallSpec.arguments)) + json("tool_calls") shouldBe JsArray( + Seq( + Json.obj( + "id" -> JsString(toolId), + "type" -> JsString("function"), + "function" -> Json.obj( + "name" -> JsString(toolCallSpec.name), + "arguments" -> JsString(toolCallSpec.arguments) + ) + ) ) - )) + ) } } @@ -310,7 +316,10 @@ class MessageJsonSpec extends Matchers with AnyWordSpecLike { json("role") shouldBe JsString("assistant") json("function_call").asOpt[JsObject] shouldBe defined - json("function_call") shouldBe Json.obj("name" -> JsString(functionCallSpec.name), "arguments" -> JsString(functionCallSpec.arguments)) + json("function_call") shouldBe Json.obj( + "name" -> JsString(functionCallSpec.name), + "arguments" -> JsString(functionCallSpec.arguments) + ) } }