承接 shale-php/shale 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

shale-php/shale

最新稳定版本:v0.11

Composer 安装命令:

composer require shale-php/shale

包简介

A package for interacting with the Amazon Bedrock service

README 文档

README

Shale is a package to interact with AWS Bedrock, a service that provides a way to interact with LLMs (Large Language Models) in a secure and scalable way within the AWS infrastructure. You can learn more about Amazon Bedrock here.

Installation

You can install the package via composer:

composer require shale-php/shale

Next, publish the configuration file:

php artisan vendor:publish --tag=shale-config

This will auto discover the package and you can start using it straight away.

Usage

First make sure you have the following environment variables set in your Laravel application:

AWS_DEFAULT_REGION=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=

Next make sure you have requested access to the bedrock models you want to use in your region within your AWS console.

You can then use the following code to interact with the bedrock model:

$question = 'What is the capital of France?';

$claudeReply = Shale::using(Claude3::make())
    ->prompt($question)
    ->execute();

$AI21LabsReply = Shale::using(AI21LabsJamba15Mini::make())
    ->prompt($question)
    ->execute();

// The capital of France is Paris.

Authors

This library was created by Richard Bagshaw.

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-12