Skip to content

Commit

Permalink
Adjust decoding strategy for stream requests (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanshine authored Apr 19, 2023
1 parent 67883a3 commit 6d9533e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Sources/OpenAIKit/RequestHandler/RequestHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ struct RequestHandler {
httpClientRequest.body = .bytes(body)
}

decoder.keyDecodingStrategy = request.keyDecodingStrategy
decoder.dateDecodingStrategy = request.dateDecodingStrategy

let response = try await httpClient.execute(httpClientRequest, timeout: .seconds(25))

return AsyncThrowingStream<T, Error> { continuation in
Expand Down

0 comments on commit 6d9533e

Please sign in to comment.