|
1 | | -# Prism Bedrock (Fork) |
| 1 | + |
2 | 2 |
|
3 | | -This is a temporary fork of [`prism-php/bedrock`](https://github.com/prism-php/bedrock) that includes bug fixes and features not yet available in the upstream package. |
| 3 | +<p align="center"> |
| 4 | + <a href="https://packagist.org/packages/prism-php/bedrock"> |
| 5 | + <img src="https://poser.pugx.org/prism-php/bedrock/d/total.svg" alt="Total Downloads"> |
| 6 | + </a> |
| 7 | + <a href="https://packagist.org/packages/prism-php/bedrock"> |
| 8 | + <img src="https://poser.pugx.org/prism-php/bedrock/v/stable.svg" alt="Latest Stable Version"> |
| 9 | + </a> |
| 10 | + <a href="https://packagist.org/packages/prism-php/bedrock"> |
| 11 | + <img src="https://poser.pugx.org/prism-php/bedrock/license.svg" alt="License"> |
| 12 | + </a> |
| 13 | +</p> |
4 | 14 |
|
5 | | -### Changes from upstream |
| 15 | +# Prism Bedrock |
6 | 16 |
|
7 | | -- **Streaming support** for both Converse and Anthropic schemas (`converse-stream` and `invoke-with-response-stream` endpoints), including tool calling during streams |
8 | | -- **ToolChoiceMap fix** for invalid payloads produced by both Anthropic and Converse schemas |
9 | | - |
10 | | -These changes will be submitted upstream. Once merged, this fork will be deprecated in favour of the official package. |
| 17 | +Unlock the power of AWS Bedrock services in your Laravel applications with Prism Bedrock. This package provides a standalone Bedrock provider for the Prism PHP framework. |
11 | 18 |
|
12 | 19 | ## Installation |
13 | 20 |
|
14 | 21 | ```bash |
15 | | -composer require wojt-janowski/bedrock |
| 22 | +composer require prism-php/bedrock |
16 | 23 | ``` |
17 | 24 |
|
18 | | -> If you are using this alongside another package that requires `prism-php/bedrock`, add a repository entry to your `composer.json` so Composer resolves from this fork: |
19 | | -> ```json |
20 | | -> "repositories": [ |
21 | | -> {"type": "vcs", "url": "https://github.com/wojt-janowski/bedrock.git"} |
22 | | -> ] |
23 | | -> ``` |
24 | | -
|
25 | 25 | ## Configuration |
26 | 26 |
|
27 | 27 | Add the following to your Prism configuration (`config/prism.php`): |
@@ -56,22 +56,6 @@ $response = Prism::text() |
56 | 56 | echo $response->text; |
57 | 57 | ``` |
58 | 58 |
|
59 | | -### Streaming |
60 | | - |
61 | | -```php |
62 | | -use Prism\Prism\Prism; |
63 | | -use Prism\Bedrock\Bedrock; |
64 | | - |
65 | | -$stream = Prism::text() |
66 | | - ->using(Bedrock::KEY, 'anthropic.claude-sonnet-4-5-20250514-v1:0') |
67 | | - ->withPrompt('Explain quantum computing in simple terms') |
68 | | - ->asStream(); |
69 | | - |
70 | | -foreach ($stream as $event) { |
71 | | - // Handle stream events (TextDeltaEvent, ToolCallEvent, etc.) |
72 | | -} |
73 | | -``` |
74 | | - |
75 | 59 | ### Structured Output (JSON) |
76 | 60 |
|
77 | 61 | ```php |
@@ -152,11 +136,11 @@ Prism Bedrock supports three of those API schemas: |
152 | 136 |
|
153 | 137 | Each schema supports different capabilities: |
154 | 138 |
|
155 | | -| Schema | Text | Streaming | Structured | Embeddings | |
156 | | -|--------|:----:|:---------:|:----------:|:----------:| |
157 | | -| Converse | ✅ | ✅ | ✅ | ❌ | |
158 | | -| Anthropic | ✅ | ✅ | ✅ | ❌ | |
159 | | -| Cohere | ❌ | ❌ | ❌ | ✅ | |
| 139 | +| Schema | Text | Structured | Embeddings | |
| 140 | +|--------|:----:|:----------:|:----------:| |
| 141 | +| Converse | ✅ | ✅ | ❌ | |
| 142 | +| Anthropic | ✅ | ✅ | ❌ | |
| 143 | +| Cohere | ❌ | ❌ | ✅ | |
160 | 144 |
|
161 | 145 | \* A unified interface for multiple providers. See [AWS documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html) for a list of supported models. |
162 | 146 |
|
@@ -235,4 +219,4 @@ The MIT License (MIT). Please see [License File](LICENSE) for more information. |
235 | 219 |
|
236 | 220 | ## Authors |
237 | 221 |
|
238 | | -The upstream library is created by [TJ Miller](https://tjmiller.me) with contributions from the [Open Source Community](https://github.com/prism-php/bedrock/graphs/contributors). This fork is maintained by [Wojt Janowski](https://github.com/wojt-janowski). |
| 222 | +This library is created by [TJ Miller](https://tjmiller.me) with contributions from the [Open Source Community](https://github.com/echolabsdev/prism-bedrock/graphs/contributors). |
0 commit comments