Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error "transferred a partial file" with azure openai chat #286

Open
pedrobtz opened this issue Jan 30, 2025 · 3 comments
Open

error "transferred a partial file" with azure openai chat #286

pedrobtz opened this issue Jan 30, 2025 · 3 comments

Comments

@pedrobtz
Copy link

I am getting the below error when using a Company instance of Azure OpenAI API, with

> chat <- chat_azure(<details>)
> chat$chat ("2+4=?")
2 + 4 = Error in readBin(resp$body, raw), n = min(chunk_size, max size - length(buffer) + :
Transferred a partial file [[COMPNAY_RESOURCE_NAME](http://COMPNAY_RESOURCE_NAME)]: transfer closed with outstanding read data remaining
Error during wrapup: cannot get a slot ("slots"? from an object of typeabort restart
  • syncs works fine
> x <- chat$chat_async("2+3=?")
> promises::then(x, print)
"2 + 3 = 5."

System: Windows, R 4.2.3,
package versions: coro: 1.1.0, httr2: 1.1.0, curl: 6.2.0, ellmer: 0.1.0

@atheriel
Copy link
Collaborator

Can you reproduce with the development version, i.e. with pak::pkg_install("tidyverse/ellmer")?

@pedrobtz
Copy link
Author

pedrobtz commented Jan 30, 2025

yes, same error with development version.

This works okay.

turns <- list(ellmer:::user_turn("2+З=?")
ellmer:::chat_perform(chat$.__enclos_env__$private$provider, mode = "value", turns = turns)

We don't access the azure endpoint directly, instead we access it via an internal URL proxy, which maybe can not handle the stream request.

Is there a way to "force" the 'chat' to use only 'value' mode?

@hadley
Copy link
Member

hadley commented Feb 2, 2025

Could you give me a full trace back just to make sure there isn’t something to do on our end?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants