From 46fd2ac2bc30af17c49f85df396ebbce0bfb0457 Mon Sep 17 00:00:00 2001 From: Shx Guo Date: Wed, 13 Mar 2024 21:15:06 +0800 Subject: [PATCH 1/3] Make OpenAI response/stream format less strict --- .../APIs/OpenAIChatCompletionsService.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Tool/Sources/OpenAIService/APIs/OpenAIChatCompletionsService.swift b/Tool/Sources/OpenAIService/APIs/OpenAIChatCompletionsService.swift index 96e1a97a..2eab6489 100644 --- a/Tool/Sources/OpenAIService/APIs/OpenAIChatCompletionsService.swift +++ b/Tool/Sources/OpenAIService/APIs/OpenAIChatCompletionsService.swift @@ -134,14 +134,14 @@ actor OpenAIChatCompletionsService: ChatCompletionsStreamAPI, ChatCompletionsAPI struct Choice: Codable, Equatable { var message: Message - var index: Int - var finish_reason: String + var index: Int? + var finish_reason: String? } struct Usage: Codable, Equatable { - var prompt_tokens: Int - var completion_tokens: Int - var total_tokens: Int + var prompt_tokens: Int? + var completion_tokens: Int? + var total_tokens: Int? } var id: String? @@ -287,7 +287,7 @@ actor OpenAIChatCompletionsService: ChatCompletionsStreamAPI, ChatCompletionsAPI return .init(chunk: chunk, done: false) } catch { Logger.service.error("Error decoding stream data: \(error)") - throw error + return .init(chunk: nil, done: false) } } From 0c244c4942e005bba469b5382201cf27cf365936 Mon Sep 17 00:00:00 2001 From: Shx Guo Date: Wed, 13 Mar 2024 21:15:45 +0800 Subject: [PATCH 2/3] Bump version to 0.31.1 --- Version.xcconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Version.xcconfig b/Version.xcconfig index deb81403..c8e46a98 100644 --- a/Version.xcconfig +++ b/Version.xcconfig @@ -1,3 +1,3 @@ -APP_VERSION = 0.31.0 -APP_BUILD = 333 +APP_VERSION = 0.31.1 +APP_BUILD = 334 From 5e099da9fcf50204b1923ba73ad89328ff61c7c6 Mon Sep 17 00:00:00 2001 From: Shx Guo Date: Wed, 13 Mar 2024 21:27:52 +0800 Subject: [PATCH 3/3] Update appcast.xml --- appcast.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/appcast.xml b/appcast.xml index 5cb4561e..234647e1 100644 --- a/appcast.xml +++ b/appcast.xml @@ -2,6 +2,18 @@ Copilot for Xcode + + 0.31.1 + Wed, 13 Mar 2024 21:24:28 +0800 + 334 + 0.31.1 + 12.0 + + https://github.com/intitni/CopilotForXcode/releases/tag/0.31.1 + + + + 0.31.0 Fri, 08 Mar 2024 14:48:32 +0800