Releases: paws-r/paws
Releases · paws-r/paws
paws-v0.8.0
Paws 0.8.0 CRAN Release 🎊🥳🎉
Features
- Streaming Support 🎊🥳🎉: Paws now returns
PawsStreamHandler
for streaming services. Learn more. This can be used in multiple ways:- Passing a function to it similar to the apply functions.
- Returning the
httr2::req_performance_connection
and parsing with Paws built-in parserpaws_stream_parser
or usinghttr2::resp_stream_aws
.
Example:
library(paws)
client <- bedrockruntime(region = "us-east-1")
model_id <- "amazon.titan-text-lite-v1:0"
conversation <- list(
list(
role = "user",
content = list(list(text = "What's your name?"))
)
)
resp <- client$converse_stream(
modelId = model_id,
messages = conversation
)
resp$stream(\(chunk) chunk$contentBlockDelta$delta$text)
# Note: stream will close connection after all chunks are read
resp <- client$converse_stream(
modelId = model_id,
messages = conversation
)
# Return httr2 req_performance_connection for full flexibility
con <- resp$stream(.connection = TRUE)
# Handle connection object using paws_stream_parser
while (!is.null(chunk <- paws_stream_parser(con))) {
print(chunk$contentBlockDelta$delta$text)
}
# Note: paws_stream_parser will close connection after all chunks are read
# Or handle connection using httr2::resp_stream_aws
while (!is.null(chunk <- resp_stream_aws(con))) {
str(chunk)
}
close(con)
Backend changes:
- Paws has migrated from aws sdk js to aws sdk python botocore AWS JSONs, which has led to a change to the endpoint regex.
Services
New Support
- bedrock-data-automation
- bedrock-data-automation-runtime
- codeconnections
Deprecated Services
- nimblestudio: AWS no longer supports Nimble. Learn more
- worklink: AWS no longer supports WorkLink.
cloudwatchevents
: AWS CloudWatch Events have been move to EventBridge to align with AWS services.
paws.common-v0.8.0
Features:
- migrate backend from
httr
tohttr2
- enrich
sso
message (#844). Thanks to @hadley for raising issue. - attempt to automatically set/refresh
sso
credentials by callingaws cli
(#844) - moved api log level to
debug
andtrace
. This is to preventinfo
level being saturated by api calls. - new
PawsStreamHandler
, allows paws to handle aws stream event (#842). Thankyou to @hadley for developing the initial solution inhttr2
.
Bug Fix:
- ensure
url
is set to lower case before signature
Potentially Breaking:
- deprecated custom handler for
s3_unmarshal_select_object_content
in favour of newPawsStreamHandler
Performance:
- migrate
parse_url
,parse_query_string
andbuild_url
tocpp
for performance improvement.
Backend Vendor:
- migrate vendor from
aws-sdk-js
toaws-sdk-python
boto3
(endpoint regex updated accordingly).
paws.common-v0.7.7
- fix unix time expiration check
- remove redundant caching method
- ensure all calls has paws user-agent string attached
paws-v0.7.0
- Support
hostPrefix
when building aws api call. This fixes services likeomics
#804 - Regenerated service api
paws.common-v0.7.6
Minor patch update, focusing on aws s3 copy functionality:
- fix handle_copy_source_param encoding redirected calls.
- fix handle_copy_source_param removing attributes
paws.common-v0.7.5
- build endpoint with host_prefix (#804), thanks to @joseale2310 and @lyschoening for raising issue.
- fix
unix_time
ensure seconds is numeric (#804), thanks to @joseale2310 and @lyschoening for raising issue. - fix stop anonymous credentials removing
x-amz-*
headers (#815) thanks to @cgostic for raising issue - fix s3 redirect for download_file
- fix encode
CopySource
in operationCopyObject
(#819) - enable lists to be passed to
CopySource
forCopyObject
operations (#819). This is to align withboto3
implementation.
library(paws)
client <- s3()
bucket = "BUCKET"
key = "%01file%/output.txt"
resp <- client$put_object(
Bucket = bucket,
Key = key,
Body = charToRaw("helloworld")
)
client$copy_object(
Bucket = bucket,
Key = "file_out_1.txt",
CopySource = sprintf("/%s/%s", bucket, key)
)
client$copy_object(
Bucket = bucket,
Key = "file_out_2.txt",
CopySource = list(
Bucket = bucket,
Key = key
)
)
- convert
uuid
tocpp
for performance improvement.
paws.common-v0.7.4
- fix
transpose
to correctly parse lists with empty first elements (#791), thanks to @FMKerckhof for raising issue. - support refreshable credentials for
sso
(#793) - fix region redirect for aws s3 buckets (#788) thanks to @payam-delfi for identifying issue
- enrich error messages to align with boto3 error message template:
# previous error message format
svc <- paws.storage::s3()
response <- svc$get_object(
Bucket = "<bucket>",
Key = "<key>",
IfNoneMatch = "<etag>"
)
#> Error: SerializationError (HTTP 304). failed to read from query HTTP response body
# new error message format
client <- paws.storage::s3()
resp <- client$get_object(
Bucket = "<bucket>",
Key = "<key>",
IfNoneMatch = "<etag>"
)
#> Error: SerializationError (HTTP 304). An error occurred when calling the GetObject operation: Not Modified
- use s3 head_bucket operation as final resort when redirecting aws s3 call.
paws-v0.6.0
Update paws SDK to the latest services for each category, please check out https://www.paws-r-sdk.com/ for full documentation.
paws.common-v0.7.3
Hot fix
- fix xml_parse to correctly parse empty elements (#783) thanks to @stevepowell99 for raising issue
paws.common-v0.7.2
Performance: 🚀
- improve performance of restxml_unmarshal up to ~ x3
New Feature: 💡
- support global endpoint_url in config file and environmental variables (#764), thanks to @James-G-Hill for raising issue
Bug Fix: 🐞
- fix rest_unmarshal_location_elements only skip header if location is not found (#761)
- ensure custom endpoints aren't modified