@@ -281,7 +281,7 @@ import Foundation
281281 }
282282
283283 /// Additional key-value pairs injected into the chat template rendering context.
284- public var additionalContext : [ String : JSONValue ] ?
284+ public var additionalContext : [ String : MLXLMCommon . JSONValue ] ?
285285
286286 var additionalContextForUserInput : [ String : any Sendable ] ? {
287287 additionalContext? . mapValues { $0. toSendable ( ) }
@@ -298,7 +298,7 @@ import Foundation
298298 public init (
299299 kvCache: KVCache ,
300300 userInputProcessing: UserInputProcessing ? ,
301- additionalContext: [ String : JSONValue ] ?
301+ additionalContext: [ String : MLXLMCommon . JSONValue ] ?
302302 ) {
303303 self . kvCache = kvCache
304304 self . additionalContext = additionalContext
@@ -1591,7 +1591,7 @@ import Foundation
15911591 {
15921592 header += " . Expected value: \( constString) "
15931593 } else if let enumValues = jsonSchema. enum, !enumValues. isEmpty,
1594- let data = try ? encoder. encode ( JSONValue . array ( enumValues) ) ,
1594+ let data = try ? encoder. encode ( enumValues) ,
15951595 let enumString = String ( data: data, encoding: . utf8)
15961596 {
15971597 header += " . Allowed values: \( enumString) "
@@ -1637,11 +1637,11 @@ import Foundation
16371637 options [ custom: MLXLanguageModel . self] ? . processingForUserInput
16381638 ?? . init( resize: nil )
16391639
1640- let userInput = makeUserInput (
1640+ let userInput = MLXLMCommon . UserInput (
16411641 chat: chat,
1642- tools: nil ,
16431642 processing: userInputProcessing,
1644- additionalContext: additionalContext
1643+ tools: nil ,
1644+ additionalContext: additionalContext,
16451645 )
16461646 let lmInput = try await context. processor. prepare ( input: userInput)
16471647
@@ -1882,7 +1882,7 @@ import Foundation
18821882 return sampledToken. item ( Int . self)
18831883 }
18841884 }
1885- extension JSONValue {
1885+ extension MLXLMCommon . JSONValue {
18861886 /// Recursively converts a `JSONValue` to its primitive Swift equivalent.
18871887 func toSendable( ) -> any Sendable {
18881888 switch self {
0 commit comments