1.17.2
AWS Bedrock provider
Connect your AI Agents to AWS Bedrock runtime to use LLMs in your private cloud. Along with AzureOpenAI, and HuggingFace providers, it makes NeuronAI the PHP AI framework with the broadest support for inference infrastructures.
namespace App\Neuron;
use Aws\BedrockRuntime\BedrockRuntimeClient;
use NeuronAI\Agent;
use NeuronAI\Chat\Messages\UserMessage;
use NeuronAI\Providers\AIProviderInterface;
use NeuronAI\Providers\AWS\BedrockRuntime;
class MyAgent extends Agent
{
public function provider(): AIProviderInterface
{
$client = new BedrockAgentRuntimeClient([
'version' => 'latest',
'region' => 'us-east-1',
'credentials' => [
'key' => 'AWS_BEDROCK_KEY',
'secret' => 'AWS_BEDROCK_SECRET',
],
]);
return new BedrockRuntime(
client: $client,
model: 'AWS_BEDROCK_MODEL',
);
}
}
echo MyAgent::make()->chat(new UserMessage("Hi!"));
// Hi, how can I help you today?