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: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ See full documentation on [https://async-aws.com](https://async-aws.com).
| [async-aws/core](https://github.com/async-aws/core) | [![Latest Stable Version](https://poser.pugx.org/async-aws/core/v/stable)](https://packagist.org/packages/async-aws/core) [![Total Downloads](https://poser.pugx.org/async-aws/core/downloads)](https://packagist.org/packages/async-aws/core) | [![](https://github.com/async-aws/core/workflows/BC%20Check/badge.svg?branch=master)](https://github.com/async-aws/core/actions) | [![](https://async-aws-pr.github.io/commits-since-release-counter/core.svg)](https://github.com/async-aws/core/releases) |
| [async-aws/app-sync](https://github.com/async-aws/app-sync) | [![Latest Stable Version](https://poser.pugx.org/async-aws/app-sync/v/stable)](https://packagist.org/packages/async-aws/app-sync) [![Total Downloads](https://poser.pugx.org/async-aws/app-sync/downloads)](https://packagist.org/packages/async-aws/app-sync) | [![](https://github.com/async-aws/app-sync/workflows/BC%20Check/badge.svg?branch=master)](https://github.com/async-aws/app-sync/actions) | [![](https://async-aws-pr.github.io/commits-since-release-counter/app-sync.svg)](https://github.com/async-aws/app-sync/releases) |
| [async-aws/athena](https://github.com/async-aws/athena) | [![Latest Stable Version](https://poser.pugx.org/async-aws/athena/v/stable)](https://packagist.org/packages/async-aws/athena) [![Total Downloads](https://poser.pugx.org/async-aws/athena/downloads)](https://packagist.org/packages/async-aws/athena) | [![](https://github.com/async-aws/athena/workflows/BC%20Check/badge.svg?branch=master)](https://github.com/async-aws/athena/actions) | [![](https://async-aws-pr.github.io/commits-since-release-counter/athena.svg)](https://github.com/async-aws/athena/releases) |
| [async-aws/bedrock-runtime](https://github.com/async-aws/bedrock-runtime) | [![Latest Stable Version](https://poser.pugx.org/async-aws/bedrock-runtime/v/stable)](https://packagist.org/packages/async-aws/bedrock-runtime) [![Total Downloads](https://poser.pugx.org/async-aws/bedrock-runtime/downloads)](https://packagist.org/packages/async-aws/bedrock-runtime) | [![](https://github.com/async-aws/bedrock-runtime/workflows/BC%20Check/badge.svg?branch=master)](https://github.com/async-aws/bedrock-runtime/actions) | [![](https://async-aws-pr.github.io/commits-since-release-counter/bedrock-runtime.svg)](https://github.com/async-aws/bedrock-runtime/releases) |
| [async-aws/cloud-formation](https://github.com/async-aws/cloud-formation) | [![Latest Stable Version](https://poser.pugx.org/async-aws/cloud-formation/v/stable)](https://packagist.org/packages/async-aws/cloud-formation) [![Total Downloads](https://poser.pugx.org/async-aws/cloud-formation/downloads)](https://packagist.org/packages/async-aws/cloud-formation) | [![](https://github.com/async-aws/cloud-formation/workflows/BC%20Check/badge.svg?branch=master)](https://github.com/async-aws/cloud-formation/actions) | [![](https://async-aws-pr.github.io/commits-since-release-counter/cloud-formation.svg)](https://github.com/async-aws/cloud-formation/releases) |
| [async-aws/cloud-front](https://github.com/async-aws/cloud-front) | [![Latest Stable Version](https://poser.pugx.org/async-aws/cloud-front/v/stable)](https://packagist.org/packages/async-aws/cloud-front) [![Total Downloads](https://poser.pugx.org/async-aws/cloud-front/downloads)](https://packagist.org/packages/async-aws/cloud-front) | [![](https://github.com/async-aws/cloud-front/workflows/BC%20Check/badge.svg?branch=master)](https://github.com/async-aws/cloud-front/actions) | [![](https://async-aws-pr.github.io/commits-since-release-counter/cloud-front.svg)](https://github.com/async-aws/cloud-front/releases) |
| [async-aws/cloud-watch](https://github.com/async-aws/cloud-watch) | [![Latest Stable Version](https://poser.pugx.org/async-aws/cloud-watch/v/stable)](https://packagist.org/packages/async-aws/cloud-watch) [![Total Downloads](https://poser.pugx.org/async-aws/cloud-watch/downloads)](https://packagist.org/packages/async-aws/cloud-watch) | [![](https://github.com/async-aws/cloud-watch/workflows/BC%20Check/badge.svg?branch=master)](https://github.com/async-aws/cloud-watch/actions) | [![](https://async-aws-pr.github.io/commits-since-release-counter/cloud-watch.svg)](https://github.com/async-aws/cloud-watch/releases) |
Expand Down Expand Up @@ -46,7 +47,7 @@ See full documentation on [https://async-aws.com](https://async-aws.com).
| [async-aws/sqs](https://github.com/async-aws/sqs) | [![Latest Stable Version](https://poser.pugx.org/async-aws/sqs/v/stable)](https://packagist.org/packages/async-aws/sqs) [![Total Downloads](https://poser.pugx.org/async-aws/sqs/downloads)](https://packagist.org/packages/async-aws/sqs) | [![](https://github.com/async-aws/sqs/workflows/BC%20Check/badge.svg?branch=master)](https://github.com/async-aws/sqs/actions) | [![](https://async-aws-pr.github.io/commits-since-release-counter/sqs.svg)](https://github.com/async-aws/sqs/releases) |
| [async-aws/ssm](https://github.com/async-aws/ssm) | [![Latest Stable Version](https://poser.pugx.org/async-aws/ssm/v/stable)](https://packagist.org/packages/async-aws/ssm) [![Total Downloads](https://poser.pugx.org/async-aws/ssm/downloads)](https://packagist.org/packages/async-aws/ssm) | [![](https://github.com/async-aws/ssm/workflows/BC%20Check/badge.svg?branch=master)](https://github.com/async-aws/ssm/actions) | [![](https://async-aws-pr.github.io/commits-since-release-counter/ssm.svg)](https://github.com/async-aws/ssm/releases) |
| [async-aws/sso](https://github.com/async-aws/sso) | [![Latest Stable Version](https://poser.pugx.org/async-aws/sso/v/stable)](https://packagist.org/packages/async-aws/sso) [![Total Downloads](https://poser.pugx.org/async-aws/sso/downloads)](https://packagist.org/packages/async-aws/sso) | [![](https://github.com/async-aws/sso/workflows/BC%20Check/badge.svg?branch=master)](https://github.com/async-aws/sso/actions) | [![](https://async-aws-pr.github.io/commits-since-release-counter/sso.svg)](https://github.com/async-aws/sso/releases) |
| [async-aws/sso-oidc](https://github.com/async-aws/sso-oidc) | [![Latest Stable Version](https://poser.pugx.org/async-aws/sso-oidc/v/stable)](https://packagist.org/packages/async-aws/sso-oidc) [![Total Downloads](https://poser.pugx.org/async-aws/sso-oidc/downloads)](https://packagist.org/packages/async-aws/sso-oidc) | [![](https://github.com/async-aws/sso-oidc/workflows/BC%20Check/badge.svg?branch=master)](https://github.com/async-aws/sso-oidc/actions) | [![](https://async-aws-pr.github.io/commits-since-release-counter/sso-oidc.svg)](https://github.com/async-aws/sso-oidc/releases) |
| [async-aws/sso-oidc](https://github.com/async-aws/sso-oidc) | [![Latest Stable Version](https://poser.pugx.org/async-aws/sso-oidc/v/stable)](https://packagist.org/packages/async-aws/sso-oidc) [![Total Downloads](https://poser.pugx.org/async-aws/sso-oidc/downloads)](https://packagist.org/packages/async-aws/sso-oidc) | [![](https://github.com/async-aws/sso-oidc/workflows/BC%20Check/badge.svg?branch=master)](https://github.com/async-aws/sso-oidc/actions) | [![](https://async-aws-pr.github.io/commits-since-release-counter/sso-oidc.svg)](https://github.com/async-aws/sso-oidc/releases) |
| [async-aws/step-functions](https://github.com/async-aws/step-functions) | [![Latest Stable Version](https://poser.pugx.org/async-aws/step-functions/v/stable)](https://packagist.org/packages/async-aws/step-functions) [![Total Downloads](https://poser.pugx.org/async-aws/step-functions/downloads)](https://packagist.org/packages/async-aws/step-functions) | [![](https://github.com/async-aws/step-functions/workflows/BC%20Check/badge.svg?branch=master)](https://github.com/async-aws/step-functions/actions) | [![](https://async-aws-pr.github.io/commits-since-release-counter/step-functions.svg)](https://github.com/async-aws/step-functions/releases) |
| [async-aws/timestream-query](https://github.com/async-aws/timestream-query) | [![Latest Stable Version](https://poser.pugx.org/async-aws/timestream-query/v/stable)](https://packagist.org/packages/async-aws/timestream-query) [![Total Downloads](https://poser.pugx.org/async-aws/timestream-query/downloads)](https://packagist.org/packages/async-aws/timestream-query) | [![](https://github.com/async-aws/timestream-query/workflows/BC%20Check/badge.svg?branch=master)](https://github.com/async-aws/timestream-query/actions) | [![](https://async-aws-pr.github.io/commits-since-release-counter/timestream-query.svg)](https://github.com/async-aws/timestream-query/releases) |
| [async-aws/timestream-write](https://github.com/async-aws/timestream-write) | [![Latest Stable Version](https://poser.pugx.org/async-aws/timestream-write/v/stable)](https://packagist.org/packages/async-aws/timestream-write) [![Total Downloads](https://poser.pugx.org/async-aws/timestream-write/downloads)](https://packagist.org/packages/async-aws/timestream-write) | [![](https://github.com/async-aws/timestream-write/workflows/BC%20Check/badge.svg?branch=master)](https://github.com/async-aws/timestream-write/actions) | [![](https://async-aws-pr.github.io/commits-since-release-counter/timestream-write.svg)](https://github.com/async-aws/timestream-write/releases) |
Expand Down
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"psr-4": {
"AsyncAws\\AppSync\\": "src/Service/AppSync/src",
"AsyncAws\\Athena\\": "src/Service/Athena/src",
"AsyncAws\\BedrockRuntime\\": "src/Service/BedrockRuntime/src",
"AsyncAws\\CloudFormation\\": "src/Service/CloudFormation/src",
"AsyncAws\\CloudFront\\": "src/Service/CloudFront/src",
"AsyncAws\\CloudWatchLogs\\": "src/Service/CloudWatchLogs/src",
Expand Down Expand Up @@ -102,6 +103,7 @@
"psr-4": {
"AsyncAws\\AppSync\\Tests\\": "src/Service/AppSync/tests",
"AsyncAws\\Athena\\Tests\\": "src/Service/Athena/tests",
"AsyncAws\\BedrockRuntime\\Tests\\": "src/Service/BedrockRuntime/tests",
"AsyncAws\\CloudFormation\\Tests\\": "src/Service/CloudFormation/tests",
"AsyncAws\\CloudFront\\Tests\\": "src/Service/CloudFront/tests",
"AsyncAws\\CloudWatchLogs\\Tests\\": "src/Service/CloudWatchLogs/tests",
Expand Down
3 changes: 3 additions & 0 deletions couscous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ menu:
athena:
text: Athena
url: /clients/athena.html
bedrock-runtime:
text: Bedrock Runtime
url: /clients/bedrock-runtime.html
cf:
text: Cloud Formation
url: /clients/cf.html
Expand Down
43 changes: 43 additions & 0 deletions docs/clients/bedrock-runtime.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
layout: client
category: clients
name: BedrockRuntime
package: async-aws/bedrock-runtime
---

## Usage

### InvokeModel

```php
use AsyncAws\BedrockRuntime\BedrockRuntimeClient;
use AsyncAws\BedrockRuntime\Input\InvokeModelRequest;

$bedrockRuntime = new BedrockRuntimeClient();

$body = [
'anthropic_version' => 'bedrock-2023-05-31',
'max_tokens' => 4096,
'messages' => [
[
'role' => 'user',
'content' => [
['type' => 'text', 'text' => 'Write me a love poem.']
]
]
],
'temperature' => 1
];

$result = $bedrockRuntime->invokeModel(new InvokeModelRequest([
'modelId' => 'us.anthropic.claude-3-7-sonnet-20250219-v1:0',
'contentType' => 'application/json',
'body' => json_encode($body, JSON_THROW_ON_ERROR)
]));

$response = json_decode($result->getBody(), true, 512, JSON_THROW_ON_ERROR);

echo $response['content'][0]['text'];

```
more information [InvokeModel](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModel.html)
1 change: 1 addition & 0 deletions docs/clients/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ for more information.
|---------------------------------------------|-----------------------------------------------------------------------------------------------------------|
| [AppSync](./app-sync.md) | [async-aws/app-sync](https://packagist.org/packages/async-aws/app-sync) |
| [Athena](./athena.md) | [async-aws/athena](https://packagist.org/packages/async-aws/athena) |
| [BedrockRuntime](./bedrock-runtime.md) | [async-aws/bedrock-runtime](https://packagist.org/packages/async-aws/bedrock-runtime) |
| [CloudFormation](./cf.md) | [async-aws/cloud-formation](https://packagist.org/packages/async-aws/cloud-formation) |
| [CloudFront](./cloud-front.md) | [async-aws/cloud-front](https://packagist.org/packages/async-aws/cloud-front) |
| [CloudWatch](./cloud-watch.md) | [async-aws/cloud-watch](https://packagist.org/packages/async-aws/cloud-watch) |
Expand Down
10 changes: 10 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@
]
}
},
"BedrockRuntime": {
"source": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/bedrock-runtime/2023-09-30/api-2.json",
"documentation": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/bedrock-runtime/2023-09-30/docs-2.json",
"pagination": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/bedrock-runtime/2023-09-30/paginators-1.json",
"example": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/bedrock-runtime/2023-09-30/examples-1.json",
"api-reference": "https://docs.aws.amazon.com/bedrock/latest/APIReference",
"methods": [
"InvokeModel"
]
},
"CloudFormation": {
"source": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/cloudformation/2010-05-15/api-2.json",
"documentation": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/cloudformation/2010-05-15/docs-2.json",
Expand Down
1 change: 1 addition & 0 deletions src/Core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Added

- AWS api-change: Added `us-isof-east-1` and `us-isof-south-1` regions
- Support for BedrockRuntime

## 1.24.1

Expand Down
14 changes: 14 additions & 0 deletions src/Core/src/AwsClientFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use AsyncAws\AppSync\AppSyncClient;
use AsyncAws\Athena\AthenaClient;
use AsyncAws\BedrockRuntime\BedrockRuntimeClient;
use AsyncAws\CloudFormation\CloudFormationClient;
use AsyncAws\CloudFront\CloudFrontClient;
use AsyncAws\CloudWatch\CloudWatchClient;
Expand Down Expand Up @@ -118,6 +119,19 @@ public function appSync(): AppSyncClient
return $this->serviceCache[__METHOD__];
}

public function bedrockRuntime(): BedrockRuntimeClient
{
if (!class_exists(BedrockRuntimeClient::class)) {
throw MissingDependency::create('async-aws/bedrock-runtime', 'BedrockRuntime');
}

if (!isset($this->serviceCache[__METHOD__])) {
$this->serviceCache[__METHOD__] = new BedrockRuntimeClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
}

return $this->serviceCache[__METHOD__];
}

public function cloudFormation(): CloudFormationClient
{
if (!class_exists(CloudFormationClient::class)) {
Expand Down
4 changes: 4 additions & 0 deletions src/Integration/Symfony/Bundle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## NOT RELEASED

### Added

- Support for BedrockRuntime

## 1.13.0

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/Integration/Symfony/Bundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.13-dev"
"dev-master": "1.14-dev"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ public static function getAllServices(): array
'class' => \AsyncAws\Athena\AthenaClient::class,
'package' => 'async-aws/athena',
],
'bedrock_runtime' => [
'class' => \AsyncAws\BedrockRuntime\BedrockRuntimeClient::class,
'package' => 'async-aws/bedrock-runtime',
],
'cloud_formation' => [
'class' => \AsyncAws\CloudFormation\CloudFormationClient::class,
'package' => 'async-aws/cloud-formation',
Expand Down
5 changes: 5 additions & 0 deletions src/Service/BedrockRuntime/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/.github export-ignore
/tests export-ignore
/.gitignore export-ignore
/Makefile export-ignore
/phpunit.xml.dist export-ignore
3 changes: 3 additions & 0 deletions src/Service/BedrockRuntime/.github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: [nyholm, jderusse]
2 changes: 2 additions & 0 deletions src/Service/BedrockRuntime/.github/workflows/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[*.yml]
indent_size = 2
38 changes: 38 additions & 0 deletions src/Service/BedrockRuntime/.github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: BC Check

on:
push:
branches:
- master

jobs:
roave-bc-check:
name: Roave BC Check
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Modify composer.json
run: |
sed -i -re 's/"require": \{/"minimum-stability": "dev","prefer-stable": true,"require": \{/' composer.json
cat composer.json

git config --local user.email "[email protected]"
git config --local user.name "AsyncAws Bot"
git commit -am "Allow unstable dependencies"

- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
tools: composer:v2

- name: Install roave/backward-compatibility-check
run: composer require --dev roave/backward-compatibility-check

- name: Roave BC Check
run: vendor/bin/roave-backward-compatibility-check
Loading