Download the PHP package descom/ai-core without Composer

On this page you can find all versions of the php package descom/ai-core. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ai-core

Ai

tests static analysis lint

Installation

Usage

BedrockClientConverse is the wrapper around AWS Bedrock's Converse API. The recommended way to use it is through the Agent abstraction; you can also instantiate the client directly when you need finer control over the message history.

1. Recommended flow — extend Agent

Define an agent by extending Descom\Ai\Bedrock\Converse\Agent and providing a model id, a system prompt and the list of tools (empty array if you don't use any):

Agent exposes three convenience helpers that build the Messages collection for you:

2. Direct use of BedrockClientConverse

When you need to build a custom message history (multi-turn conversation, mixed roles, replayed transcripts) instantiate the client directly with an Agent and call request():

3. Multi-modal message (image + text in a single turn)

A single message can carry several content items. Combine TextContent with ImageContent, DocumentContent or AudioContent, and choose BinarySource (raw bytes) or S3Source (objects stored in S3):

4. Tool calling

Define a tool by implementing Descom\Ai\Tools\ToolsContract:

Then expose it from your agent's tools() method. Each entry describes the JSON schema sent to Bedrock and the PHP class that handles invocations:

When the model returns a tool_use stop reason, BedrockClientConverse::request() automatically runs the tool, appends its result to the conversation and re-calls the model — your code only needs to read the final Response.

5. Inspecting the response

request() returns a Descom\Ai\Bedrock\Messages\Response\Response with typed accessors:

6. Error handling

Any AWS SDK exception raised during the underlying converse() call is wrapped in BedrockRequestException. The original exception is preserved as $previous, and the offending request payload is exposed on the payload property for debugging:


All versions of ai-core with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
aws/aws-sdk-php Version ^3.300
illuminate/contracts Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package descom/ai-core contains the following files

Loading the files please wait ...