Skip to content

Commit

Permalink
Merge pull request #65 from romainfrancois/use_httr2_req_perform_stre…
Browse files Browse the repository at this point in the history
…am_lines

Use `httr2::req_perform_stream(round = "line")`
  • Loading branch information
edgararuiz authored Feb 20, 2024
2 parents bc8f3b5 + 4b03ad6 commit fb75dfd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ Suggests:
testthat (>= 3.0.0)
Config/testthat/edition: 3
VignetteBuilder: knitr
Remotes: r-lib/httr2

4 changes: 2 additions & 2 deletions R/backend-openai-core.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ openai_stream_ide <- function(defaults, req_body) {
openai_stream_ide_delta(x, defaults)
TRUE
},
buffer_kb = 0.1
buffer_kb = 0.1, round = "line"
)
if (!ui_current_console()) ide_paste_text("\n\n")
ret <- ch_env$stream$response
Expand Down Expand Up @@ -121,7 +121,7 @@ openai_stream_file <- function(
openai_stream_file_delta(x, defaults, r_file_stream)
TRUE
},
buffer_kb = 0.05
buffer_kb = 0.05, round = "line"
)
ret <- readRDS(r_file_stream)
saveRDS(ret, r_file_complete)
Expand Down

0 comments on commit fb75dfd

Please sign in to comment.