Skip to content

Commit

Permalink
JsonSchema object - switching properties to Seq instead of Map to hav…
Browse files Browse the repository at this point in the history
…e deterministic serialization
  • Loading branch information
peterbanda committed Nov 26, 2024
1 parent 7e5d455 commit 3b48c22
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@ object JsonSchema {
import java.lang.{String => JString}

case class Object(
properties: Map[JString, JsonSchema],
properties: Seq[(JString, JsonSchema)],
required: Seq[JString] = Nil
) extends JsonSchema {
override val `type` = JsonType.Object
}

def Object(
properties: Map[JString, JsonSchema],
required: Seq[JString] = Nil
): Object = Object(properties.toSeq, required)

case class String(
description: Option[JString] = None,
`enum`: Seq[JString] = Nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import io.cequence.openaiscala.service.OpenAIChatCompletionService
import io.cequence.openaiscala.service.adapter.ServiceWrapperTypes._
import io.cequence.wsclient.service.CloseableService
import io.cequence.wsclient.service.adapter.ServiceWrapperTypes.CloseableServiceWrapper
import io.cequence.wsclient.service.adapter.{DelegatedCloseableServiceWrapper, ServiceWrapper}
import io.cequence.wsclient.service.adapter.DelegatedCloseableServiceWrapper

import scala.concurrent.Future

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package io.cequence.openaiscala.examples.nonopenai

import io.cequence.openaiscala.anthropic.domain.Content.ContentBlock.TextBlock
import io.cequence.openaiscala.anthropic.domain.Content.{ContentBlockBase, SingleString}
import io.cequence.openaiscala.anthropic.domain.{Content, Message}
import io.cequence.openaiscala.anthropic.domain.Content.ContentBlockBase
import io.cequence.openaiscala.anthropic.domain.Message
import io.cequence.openaiscala.anthropic.domain.Message.{SystemMessage, UserMessage}
import io.cequence.openaiscala.anthropic.domain.response.CreateMessageResponse
import io.cequence.openaiscala.anthropic.domain.settings.AnthropicCreateMessageSettings
Expand Down

0 comments on commit 3b48c22

Please sign in to comment.