Skip to content

Commit 1a87446

Browse files
committed
The scope of implicit stringAnyMapFormat limited to FunctionSpec
1 parent 578c269 commit 1a87446

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

openai-client/src/main/scala/io/cequence/openaiscala/JsonFormats.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,13 @@ object JsonFormats {
4242
implicit val functionCallSpecFormat: Format[FunctionCallSpec] = Json.format[FunctionCallSpec]
4343
implicit val messageSpecFormat: Format[MessageSpec] = Json.format[MessageSpec]
4444
implicit val funMessageSpecFormat: Format[FunMessageSpec] = Json.format[FunMessageSpec]
45-
private implicit val stringAnyMapFormat: Format[Map[String, Any]] = JsonUtil.StringAnyMapFormat
46-
implicit val functionSpecFormat: Format[FunctionSpec] = Json.format[FunctionSpec]
45+
46+
implicit val functionSpecFormat: Format[FunctionSpec] = {
47+
// use just here for FunctionSpec
48+
implicit val stringAnyMapFormat: Format[Map[String, Any]] = JsonUtil.StringAnyMapFormat
49+
Json.format[FunctionSpec]
50+
}
51+
4752
implicit val chatMessageFormat: Format[ChatMessage] = Json.format[ChatMessage]
4853
implicit val chatCompletionChoiceInfoFormat: Format[ChatCompletionChoiceInfo] = Json.format[ChatCompletionChoiceInfo]
4954
implicit val chatCompletionResponseFormat: Format[ChatCompletionResponse] = Json.format[ChatCompletionResponse]

0 commit comments

Comments
 (0)