Download the PHP package claude-php/claude-3-api without Composer
On this page you can find all versions of the php package claude-php/claude-3-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download claude-php/claude-3-api
More information about claude-php/claude-3-api
Files in claude-php/claude-3-api
Package claude-3-api
Short Description A PHP package for the Claude 3.5 Sonnet API
License MIT
Informations about the package claude-3-api
Claude 3 API PHP Package
A robust PHP package for interacting with Anthropic's Claude 3 API, supporting both text and vision capabilities.
Features
- Easy-to-use interface for sending messages to Claude 3
- Support for text-based conversations with a simple chat method
- Vision capabilities - send images along with text prompts
- Streaming support for real-time responses
- Tool usage support
- Comprehensive error handling
- Fully tested with PHPUnit
Installation
You can install the package via composer:
Usage
Basic Chat Usage
For simple text-based interactions, you can use the chat
method:
Basic Chat Usage
For simple text-based interactions, you can use the chat
method in several ways:
-
Send a single string message:
-
Send a single message as an array:
-
Continue a conversation with multiple messages:
- Specify a model or max tokens (optional):
The chat
method is flexible and can handle various input formats, making it easy to interact with Claude in different scenarios.
Advanced Usage
For more complex scenarios, you can still use the sendMessage
method with a MessageRequest
object:
Vision Capabilities
Streaming
Using Tools
Testing
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This Claude 3 API Package is open-sourced software licensed under the MIT license.
Support
If you encounter any problems or have any questions, please open an issue in the GitHub repository.
Disclaimer
This package is not officially associated with Anthropic. Make sure to comply with Anthropic's terms of service when using this package.