Download the PHP package premieroctet/php-stream-protocol without Composer
On this page you can find all versions of the php package premieroctet/php-stream-protocol. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package php-stream-protocol
PHP Stream Protocol ▲
A PHP library for handling the Vercel AI SDK Stream Protocol. This package provides an easy-to-use interface for creating streaming AI responses with support for tool calls, attachments, and various AI providers.
Features
- 🚀 Easy Integration: Simple, fluent API for streaming responses
- 🔧 Tool Support: Built-in tool calling and execution
- 📎 Attachments: Handle file and image attachments
- 🔄 Multi-Provider: Support for OpenAI, Anthropic Claude, and more
- 📊 Protocol Compliant: Follows Vercel AI SDK Stream Protocol specifications
- ⚡ Symfony Integration: Built with Symfony components
Installation
Quick Start
Basic Usage
Symfony Usage
Advanced Usage with Custom Tools
Message Conversion
Simple Text Streaming (for testing)
Message Format
The library handles messages in the Vercel AI SDK format, supporting:
- Text messages: Simple text content
- Tool calls: Function calling with arguments and results
- Attachments: File and image attachments
- Message parts: Complex message structures
Example message structure:
Stream Protocol
The library implements the Vercel AI SDK Stream Protocol with the following message types:
0:
- Text content9:
- Tool calla:
- Tool resultb:
- Tool call streaming startc:
- Tool call deltad:
- Finish messagee:
- Finish stepf:
- Message start
Tool Integration
Tools must follow this interface:
Requirements
- PHP 8.1 or higher
- Symfony HttpFoundation component
License
MIT License - see LICENSE file for details.
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
All versions of php-stream-protocol with dependencies
PHP Build Version
Package Version
The package premieroctet/php-stream-protocol contains the following files
Loading the files please wait ....