Skip to content

Commit

Permalink
Merge pull request #149 from frogcjn/patch-1
Browse files Browse the repository at this point in the history
trimming contentString
  • Loading branch information
ingvarus-bc authored Feb 2, 2024
2 parents 60dfce4 + c271966 commit 25f93ee
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Sources/OpenAI/Private/StreamingSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ extension StreamingSession {
return
}
let jsonObjects = "\(previousChunkBuffer)\(stringContent)"
.trimmingCharacters(in: .whitespacesAndNewlines)
.components(separatedBy: "data:")
.map { $0.trimmingCharacters(in: .whitespacesAndNewlines) }
.filter { $0.isEmpty == false }
Expand Down

0 comments on commit 25f93ee

Please sign in to comment.