All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Dropped support for PHP 7.4. PHP 8.1 or higher is now required.
-
Streaming Support:
- Added support for streaming responses in the
MistralAI
class, allowing real-time token generation for thecreateChatCompletion
method and other applicable endpoints. - Implemented a callback mechanism for handling streamed data in real time.
- Added support for streaming responses in the
-
New Endpoints:
- Models:
retrieveModel
: Retrieve information about a specific model by its ID.deleteModel
: Delete a fine-tuned model by its ID.updateFineTunedModel
: Update fine-tuning for a specific model.archiveModel
: Archive a fine-tuned model.unarchiveModel
: Unarchive a fine-tuned model.
- Files:
uploadFile
: Upload a file for use in fine-tuning.listFiles
: Retrieve a list of all uploaded files.retrieveFile
: Retrieve details of a specific file by its ID.deleteFile
: Delete a file by its ID.
- Fine-Tuning Jobs:
listFineTuningJobs
: Get a list of all fine-tuning jobs.retrieveFineTuningJob
: Retrieve details of a specific fine-tuning job by its ID.cancelFineTuningJob
: Cancel a fine-tuning job.startFineTuningJob
: Start a fine-tuning job.createFineTuningJob
: Create a new fine-tuning job.
- FIM Completion:
createFimCompletion
: Generate Fill-In-the-Middle (FIM) text completions.
- Agents Completion:
createAgentsCompletion
: Generate completions based on agents or specialized workflows.
- Models:
-
New Examples:
- Created new example files to showcase API usage and functionality. All examples were aligned with the OpenAPI specification, using relevant model descriptions and proper documentation:
- Chat Completion with Streaming:
examples/chat/createChatCompletion.php
- Demonstrates how to create a chat completion with the
mistral-small-latest
model, featuring real-time response streaming.
- Demonstrates how to create a chat completion with the
- Retrieve Model:
examples/models/retrieveModel.php
- Demonstrates how to retrieve detailed information about a specific model using the
retrieveModel
endpoint.
- Demonstrates how to retrieve detailed information about a specific model using the
- Delete Model:
examples/models/deleteModel.php
- Shows how to delete a specific model using the
deleteModel
endpoint.
- Shows how to delete a specific model using the
- Archive/Unarchive Model:
examples/models/archiveModel.php
examples/models/unarchiveModel.php
- These examples show how to archive and unarchive models respectively.
- File Management:
- Upload File:
examples/files/uploadFile.php
- List Files:
examples/files/listFiles.php
- Retrieve File:
examples/files/retrieveFile.php
- Delete File:
examples/files/deleteFile.php
- Upload File:
- Fine-Tuning Jobs:
- List Fine-Tuning Jobs:
examples/finetuning/listFineTuningJobs.php
- Retrieve Fine-Tuning Job:
examples/finetuning/retrieveFineTuningJob.php
- Cancel Fine-Tuning Job:
examples/finetuning/cancelFineTuningJob.php
- Start Fine-Tuning Job:
examples/finetuning/startFineTuningJob.php
- Create Fine-Tuning Job:
examples/finetuning/createFineTuningJob.php
- List Fine-Tuning Jobs:
- FIM Completion:
examples/fim/createFimCompletion.php
- Demonstrates the
createFimCompletion
method to generate Fill-In-the-Middle completions.
- Demonstrates the
- Agents Completion:
examples/agents/createAgentsCompletion.php
- Shows how to use the
createAgentsCompletion
method to generate agents-based text completions.
- Shows how to use the
- Chat Completion with Streaming:
- Created new example files to showcase API usage and functionality. All examples were aligned with the OpenAPI specification, using relevant model descriptions and proper documentation:
-
Factory Updates:
- Added real-time processing of streamed content in the
MistralAIFactory::request
method.
- Added real-time processing of streamed content in the
-
Enhanced Documentation:
- Provided detailed docblocks for all example files.
- Example docblocks include model descriptions, usage instructions, expected output, and references to the OpenAPI specification.
- Refactor of the
MistralAI
class:- Adjusted the
__call
method to better align with the updatedMistralAIURLBuilder
, ensuring proper extraction of parameters and options. - Enhanced error handling and validation for parameter inputs to improve robustness.
- Updated request generation to handle both JSON and multipart request bodies, as required by specific API endpoints (e.g., file uploads).
- Implemented better multipart handling for file upload scenarios.
- Adjusted the
- Refactor of the Unit Tests:
- Updated unit tests to reflect the new API endpoints and streaming capabilities.
- Added new test cases for the new endpoints and streaming functionality.
- Initial release of the Mistral AI PHP library.
- Basic implementation for making API calls to the Mistral API.
- Unit tests for the initial implementation.