Skip to content

Commit 61056fe

Browse files
committed
Fixing Scala 3 compilation issues
1 parent ca54189 commit 61056fe

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

openai-core/src/main/scala/io/cequence/openaiscala/domain/responsesapi/tools/JsonFormats.scala

+5-4
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ object JsonFormats {
274274
(__ \ "action").format[ComputerToolAction] and
275275
(__ \ "call_id").format[String] and
276276
(__ \ "id").format[String] and
277-
(__ \ "pending_safety_checks").formatWithDefault(Seq.empty[PendingSafetyCheck]) and
277+
(__ \ "pending_safety_checks")
278+
.formatWithDefault[Seq[PendingSafetyCheck]](Seq.empty[PendingSafetyCheck]) and
278279
(__ \ "status").format[ModelStatus]
279280
)(
280281
ComputerToolCall.apply _,
@@ -284,9 +285,9 @@ object JsonFormats {
284285
implicit lazy val fileSearchToolCallFormat: OFormat[FileSearchToolCall] =
285286
(
286287
(__ \ "id").format[String] and
287-
(__ \ "queries").formatWithDefault(Seq.empty[String]) and
288+
(__ \ "queries").formatWithDefault[Seq[String]](Seq.empty[String]) and
288289
(__ \ "status").format[ModelStatus] and
289-
(__ \ "results").formatWithDefault(Seq.empty[FileSearchResult])
290+
(__ \ "results").formatWithDefault[Seq[FileSearchResult]](Seq.empty[FileSearchResult])
290291
)(
291292
FileSearchToolCall.apply _,
292293
(x: FileSearchToolCall) => (x.id, x.queries, x.status, x.results)
@@ -348,7 +349,7 @@ object JsonFormats {
348349
(
349350
(__ \ "call_id").format[String] and
350351
(__ \ "output").format[ComputerScreenshot] and
351-
(__ \ "acknowledged_safety_checks").formatWithDefault(
352+
(__ \ "acknowledged_safety_checks").formatWithDefault[Seq[AcknowledgedSafetyCheck]](
352353
Seq.empty[AcknowledgedSafetyCheck]
353354
) and
354355
(__ \ "id").formatNullable[String] and

openai-examples/src/main/scala/io/cequence/openaiscala/examples/responsesapi/CreateModelResponseWithFunctions.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ object CreateModelResponseWithFunctions extends Example {
2525
description = Some("The city and state, e.g. San Francisco, CA")
2626
),
2727
"unit" -> JsonSchema.String(
28-
enum = Seq("celsius", "fahrenheit")
28+
`enum` = Seq("celsius", "fahrenheit")
2929
)
3030
),
3131
required = Seq("location", "unit")

0 commit comments

Comments
 (0)