clinically/laravel-ai-bedrock 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

clinically/laravel-ai-bedrock

Composer 安装命令:

composer require clinically/laravel-ai-bedrock

包简介

AWS Bedrock provider for the Laravel AI SDK

README 文档

README

This package is deprecated and no longer maintained.

AWS Bedrock support is now built into laravel/ai natively (since v0.6.3, April 2026, via PR #270). The native provider covers everything this package bridged — streaming, tool calling, embeddings (Titan + Cohere), and image generation (Nova Canvas) — built directly on the AWS SDK without a Prism dependency.

Use the native provider in laravel/ai ^0.6.3 (or newer) instead. This repository is now archived.

Migration guide

1. Update composer.json

 "require": {
-    "clinically/laravel-ai-bedrock": "^0.1",
-    "laravel/ai": "^0.3"
+    "laravel/ai": "^0.7"
 }

Then composer update.

2. Update config/ai.php

The native provider uses slightly different credential keys. Rename access_keyaccess_key_id and secret_keysecret_access_key:

 'providers' => [
     'bedrock' => [
         'driver' => 'bedrock',
-        'access_key' => env('AWS_ACCESS_KEY_ID'),
-        'secret_key' => env('AWS_SECRET_ACCESS_KEY'),
+        'access_key_id' => env('AWS_ACCESS_KEY_ID'),
+        'secret_access_key' => env('AWS_SECRET_ACCESS_KEY'),
         'session_token' => env('AWS_SESSION_TOKEN'),
         'region' => env('AWS_BEDROCK_REGION', env('AWS_DEFAULT_REGION', 'us-east-1')),
         'models' => [
             'text' => [
                 'default' => env('AWS_BEDROCK_TEXT_MODEL', 'us.anthropic.claude-sonnet-4-5-20250929-v1:0'),
                 'cheapest' => env('AWS_BEDROCK_CHEAPEST_MODEL', 'us.anthropic.claude-haiku-4-5-20251001-v1:0'),
                 'smartest' => env('AWS_BEDROCK_SMARTEST_MODEL', 'us.anthropic.claude-opus-4-6-v1'),
             ],
             'embeddings' => [
                 'default' => env('AWS_BEDROCK_EMBEDDINGS_MODEL', 'amazon.titan-embed-text-v2:0'),
                 'dimensions' => env('AWS_BEDROCK_EMBEDDINGS_DIMENSIONS', 1024),
             ],
             'image' => [
                 'default' => env('AWS_BEDROCK_IMAGE_MODEL', 'amazon.nova-canvas-v1:0'),
             ],
         ],
     ],
 ],

Note: the native provider defaults to us.-prefixed cross-region inference profile IDs for text models. Adjust to your preferred region/profile.

3. Remove the service provider registration

The native provider is wired automatically by laravel/ai. Nothing extra to register.

4. Application code

No changes needed. Ai::textProvider('bedrock'), Ai::embeddingProvider('bedrock'), and the #[Agent(provider: 'bedrock')] attribute all continue to work the same way against the native provider.

Original purpose (historical)

This package existed because the official laravel/ai SDK did not include a Bedrock provider, and the upstream prism-php/bedrock package was missing streaming support. It bridged the two via clinically/prism-bedrock (also deprecated/archived).

All of these gaps are now closed in laravel/ai itself.

License

MIT License. See LICENSE for details.

统计信息

  • 总下载量: 1.49k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固