API Reference
Complete reference for all Converse Prism methods and classes.
Overview
Converse Prism extends Laravel Converse with seamless Prism PHP integration. This API reference covers the additional methods and classes provided by this package.
Main Components
Conversation Methods
Extensions to the Conversation model for Prism integration:
toPrismText()
- Generate text completionstoPrismStructured()
- Generate structured outputstoPrismEmbeddings()
- Generate embeddingsaddPrismResponse()
- Store AI responses with metadatastreamPrismResponse()
- Handle streaming responses
Message Methods
Extensions to the Message model:
toPrismMessage()
- Convert messages to Prism format
PrismStream
The streaming handler class:
append()
- Add chunks to the streamcomplete()
- Finalize the streamfail()
- Handle stream failures
Metadata
Automatic metadata extraction and structure for AI responses.
Inherited Functionality
All standard Laravel Converse methods remain available. See the Converse documentation for the complete API reference of the base package.
Version Compatibility
- PHP: 8.2+
- Laravel: 11.0+ or 12.0+
- Converse: ^0.1
- Prism PHP: ^0.71