Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
* `chat_azure()` now picks up credentials from Azure service principals
automatically (#263, @atheriel).

* `chat_azure()` now reports better error messages when the underlying HTTP
requests fail (#269, @atheriel).

# ellmer 0.1.0

* New `chat_vllm()` to chat with models served by vLLM (#140).
Expand Down
5 changes: 4 additions & 1 deletion R/provider-azure.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ method(chat_request, ProviderAzure) <- function(provider,
}
req <- req_headers(req, !!!provider@credentials(), .redact = "Authorization")
req <- req_retry(req, max_tries = 2)
req <- req_error(req, body = function(resp) resp_body_json(resp)$message)
req <- req_error(req, body = function(resp) {
error <- resp_body_json(resp)$error
paste0(error$code, ": ", error$message)
})

messages <- compact(unlist(as_json(provider, turns), recursive = FALSE))
tools <- as_json(provider, unname(tools))
Expand Down
Loading