diff --git a/Package.resolved b/Package.resolved index ef92165..319de49 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "203e6544835d84bd20fbe6f01f08082aa5b02cfe5ebc96f023ca73a49208aa27", + "originHash" : "aeebc6c5c484553e05fa670210ea781113cfd4d79dc16ed6ee58ec6ae2cb3086", "pins" : [ { "identity" : "documentationcomment", @@ -33,8 +33,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/MacPaw/OpenAI", "state" : { - "revision" : "40f3d6cdb5a2ad72369984a8e0e99a28c6e46f47", - "version" : "0.4.2" + "revision" : "bb283b2ac48c1e90121d73d6bfb45f961dc0b7a3", + "version" : "0.4.5" } }, { @@ -46,6 +46,15 @@ "version" : "0.5.0" } }, + { + "identity" : "swift-http-types", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-http-types", + "state" : { + "revision" : "a0a57e949a8903563aba4615869310c0ebf14c03", + "version" : "1.4.0" + } + }, { "identity" : "swift-markdown", "kind" : "remoteSourceControl", @@ -55,6 +64,15 @@ "version" : "0.5.0" } }, + { + "identity" : "swift-openapi-runtime", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-openapi-runtime", + "state" : { + "revision" : "8f33cc5dfe81169fb167da73584b9c72c3e8bc23", + "version" : "1.8.2" + } + }, { "identity" : "swift-syntax", "kind" : "remoteSourceControl", diff --git a/Package.swift b/Package.swift index 6a6d5c0..7579bbe 100644 --- a/Package.swift +++ b/Package.swift @@ -17,7 +17,7 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/FunctionCalling/FunctionCalling", from: "0.5.0"), - .package(url: "https://github.com/MacPaw/OpenAI", from: "0.4.4") + .package(url: "https://github.com/MacPaw/OpenAI", from: "0.4.5") ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. diff --git a/Sources/FunctionCalling-MacPaw-OpenAI/Extension/ChatQuery+Extension.swift b/Sources/FunctionCalling-MacPaw-OpenAI/Extension/ChatQuery+Extension.swift index 12c2eb0..31cc267 100644 --- a/Sources/FunctionCalling-MacPaw-OpenAI/Extension/ChatQuery+Extension.swift +++ b/Sources/FunctionCalling-MacPaw-OpenAI/Extension/ChatQuery+Extension.swift @@ -19,16 +19,16 @@ extension ChatQuery.ChatCompletionToolParam.FunctionDefinition { self.init( name: tool.name, description: tool.description, - parameters: AnyJSONSchema(inputSchema: tool.inputSchema) + parameters: JSONSchema(inputSchema: tool.inputSchema) ) } } -extension AnyJSONSchema { +extension JSONSchema { init(inputSchema: InputSchema) { self.init(fields: [ .type(JSONSchemaInstanceType(type: inputSchema.type)), - .properties(inputSchema.properties?.mapValues { AnyJSONSchema(inputSchema: $0) } ?? [:]), + .properties(inputSchema.properties?.mapValues { JSONSchema(inputSchema: $0) } ?? [:]), .required(inputSchema.requiredProperties ?? []), .enumValues(inputSchema.enumValues ?? []) ])